-
-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V4: Message builder #2250
base: 4.0
Are you sure you want to change the base?
V4: Message builder #2250
Conversation
There should be some abstraction layer for |
We could just make stuff protected and virtual? |
@quinchs thoughts on allowing message parameters to be provided with a string operator? public class Message
{
private Message(string input)
{
}
public static implicit operator Message(string input)
=> new Message(input);
}
internal class Example
{
public void ExampleMethod()
{
Send("test");
void Send(Message message)
{
}
}
} |
Also with the same design as above, an embed could serve as operator for message: private Message(Embed input)
{
}
public static implicit operator Message(Embed embed)
=> new Message(embed); |
With the mention of 'format', another idea to consider is a |
@Rozen4334 lgtm |
Summary
This PR adds a new builder called
MessageBuilder
which can build aMessage
that is used inSendMessageAsync
functions.The upsides to this style is we can merge
SendFile
andSendMessage
functions as the library can determine whether or not the message contains files.The builder also makes building reusable message templates easier.
Todo
IMessageChannel.SendMessageAsync