-
Notifications
You must be signed in to change notification settings - Fork 89
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
Send Chat Message endpoint #211
Conversation
Pull Request Test Coverage Report for Build 7830778465
💛 - Coveralls |
chat.go
Outdated
type SendChatMessageParams struct { | ||
// The ID of the broadcaster whose chat room the message will be sent to | ||
BroadcasterID string `query:"broadcaster_id"` | ||
|
||
// The ID of the user sending the message. This ID must match the user ID in the user access token | ||
SenderID string `query:"sender_id"` | ||
|
||
// The message to send. The message is limited to a maximum of 500 characters. | ||
// Chat messages can also include emoticons. | ||
// To include emoticons, use the name of the emote. | ||
// The names are case sensitive. | ||
// Don’t include colons around the name (e.g., :bleedPurple:). | ||
// If Twitch recognizes the name, Twitch converts the name to the emote before writing the chat message to the chat room | ||
Message string `query:"message"` | ||
|
||
// The ID of the chat message being replied to | ||
ReplyParentMessageID string `query:"reply_parent_message_id"` |
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.
Thats a POST request, so it should be body fields.
Also reply_parent_message_id
is optional, so there should be omitempty
on this field.
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.
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 for my inattention. Fixed
chat.go
Outdated
return nil, errors.New("error: sender id must be specified") | ||
} | ||
|
||
resp, err := c.put("/chat/messages", &ManyChatMessages{}, params) |
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.
Thats a post, not put.
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.
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.
Fixed
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.
Thanks @diPhantxm. And thanks for the review @Satont
Closes #210