Skip to content
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

Merged
merged 2 commits into from
Feb 8, 2024
Merged

Conversation

diPhantxm
Copy link
Contributor

Closes #210

@coveralls
Copy link

coveralls commented Feb 2, 2024

Pull Request Test Coverage Report for Build 7830778465

  • 0 of 16 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 92.582%

Totals Coverage Status
Change from base Build 7458906178: 0.07%
Covered Lines: 1685
Relevant Lines: 1820

💛 - Coveralls

chat.go Outdated
Comment on lines 432 to 448
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"`
Copy link
Contributor

@Satont Satont Feb 8, 2024

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Owner

@nicklaw5 nicklaw5 left a 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

@nicklaw5 nicklaw5 merged commit c0c9d30 into nicklaw5:main Feb 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add send message endpoint request
4 participants