-
Notifications
You must be signed in to change notification settings - Fork 787
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
SetContent #352
SetContent #352
Conversation
One problem I see is that you need to set Should I make a getter method? Should I remove the pointer, so it defaults to an empty struct? |
A friend of mine got weird behaviours, such as negative numbers. Now I'm gonna gather everything I can to put an end to this problem once and for all
message.go
Outdated
Nonce string `json:"nonce"` | ||
MessageEdit | ||
Tts bool `json:"tts"` | ||
Embed *MessageEmbed `json:"embed"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Embed is defined on MessageEdit, you shouldn't need this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oo right! Missed that! 1 second!
message.go
Outdated
Nonce string `json:"nonce"` | ||
MessageEdit | ||
Tts bool `json:"tts"` | ||
Embed *MessageEmbed `json:"embed"` | ||
} | ||
|
||
// MessageEdit stores all parameters you can send with ChannelMessageSendComplex. | ||
type MessageEdit struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better name here? Do we need the MessageEdit? What if we just document that Tts doesn't work when editing? In that way we could just have 'MessageParameters' as the only struct that both ComplexSend and ComplexEdit take.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, OK!
Lint comment errors breaking the build, but this looks good. |
Already on it ;) |
message.go
Outdated
// MessageParams is used in MessageSend and MessageEdit to share common parameters. | ||
type MessageParams struct { | ||
Content *string `json:"content,omitempty"` | ||
Embed *MessageEmbed `json:"embed"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SORRY! Last thing! This should be omitempty also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right! No problem!
Thanks so much dude! 💯 💯 🥇 |
* SendContent * Fixed error...? * Commented * Yep let's do that * Oops * Oki * Whatever you say, Travis... :< * Omit them empty structs
See #351