mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-09-11 00:42:30 +00:00
14
vendor/github.com/bwmarrin/discordgo/restapi.go
generated
vendored
14
vendor/github.com/bwmarrin/discordgo/restapi.go
generated
vendored
@@ -90,7 +90,7 @@ func (s *Session) RequestWithLockedBucket(method, urlStr, contentType string, b
|
||||
|
||||
req.Header.Set("Content-Type", contentType)
|
||||
// TODO: Make a configurable static variable.
|
||||
req.Header.Set("User-Agent", "DiscordBot (https://github.com/bwmarrin/discordgo, v"+VERSION+")")
|
||||
req.Header.Set("User-Agent", s.UserAgent)
|
||||
|
||||
if s.Debug {
|
||||
for k, v := range req.Header {
|
||||
@@ -617,10 +617,10 @@ func (s *Session) GuildCreate(name string) (st *Guild, err error) {
|
||||
// g : A GuildParams struct with the values Name, Region and VerificationLevel defined.
|
||||
func (s *Session) GuildEdit(guildID string, g GuildParams) (st *Guild, err error) {
|
||||
|
||||
// Bounds checking for VerificationLevel, interval: [0, 3]
|
||||
// Bounds checking for VerificationLevel, interval: [0, 4]
|
||||
if g.VerificationLevel != nil {
|
||||
val := *g.VerificationLevel
|
||||
if val < 0 || val > 3 {
|
||||
if val < 0 || val > 4 {
|
||||
err = ErrVerificationLevelBounds
|
||||
return
|
||||
}
|
||||
@@ -2067,7 +2067,7 @@ func (s *Session) WebhookDeleteWithToken(webhookID, token string) (st *Webhook,
|
||||
// WebhookExecute executes a webhook.
|
||||
// webhookID: The ID of a webhook.
|
||||
// token : The auth token for the webhook
|
||||
// wait : Wait for server to confirm the message arrival
|
||||
// wait : Waits for server confirmation of message send and ensures that the return struct is populated (it is nil otherwise)
|
||||
//
|
||||
// If `wait` is `false`, the returned *Message is always empty, because server
|
||||
// does not provide the response data.
|
||||
@@ -2150,6 +2150,8 @@ func (s *Session) WebhookExecute(webhookID, token string, wait bool, data *Webho
|
||||
// emojiID : Either the unicode emoji for the reaction, or a guild emoji identifier.
|
||||
func (s *Session) MessageReactionAdd(channelID, messageID, emojiID string) error {
|
||||
|
||||
// emoji such as #⃣ need to have # escaped
|
||||
emojiID = strings.Replace(emojiID, "#", "%23", -1)
|
||||
_, err := s.RequestWithBucketID("PUT", EndpointMessageReaction(channelID, messageID, emojiID, "@me"), nil, EndpointMessageReaction(channelID, "", "", ""))
|
||||
|
||||
return err
|
||||
@@ -2162,6 +2164,8 @@ func (s *Session) MessageReactionAdd(channelID, messageID, emojiID string) error
|
||||
// userID : @me or ID of the user to delete the reaction for.
|
||||
func (s *Session) MessageReactionRemove(channelID, messageID, emojiID, userID string) error {
|
||||
|
||||
// emoji such as #⃣ need to have # escaped
|
||||
emojiID = strings.Replace(emojiID, "#", "%23", -1)
|
||||
_, err := s.RequestWithBucketID("DELETE", EndpointMessageReaction(channelID, messageID, emojiID, userID), nil, EndpointMessageReaction(channelID, "", "", ""))
|
||||
|
||||
return err
|
||||
@@ -2183,6 +2187,8 @@ func (s *Session) MessageReactionsRemoveAll(channelID, messageID string) error {
|
||||
// emojiID : Either the unicode emoji for the reaction, or a guild emoji identifier.
|
||||
// limit : max number of users to return (max 100)
|
||||
func (s *Session) MessageReactions(channelID, messageID, emojiID string, limit int) (st []*User, err error) {
|
||||
// emoji such as #⃣ need to have # escaped
|
||||
emojiID = strings.Replace(emojiID, "#", "%23", -1)
|
||||
uri := EndpointMessageReactions(channelID, messageID, emojiID)
|
||||
|
||||
v := url.Values{}
|
||||
|
Reference in New Issue
Block a user