forked from pothtonswer/discordmuffin
GuildBan method and UnknownBan error code addition (#848)
* UnknownBan error code addition * GuildBan method implementation * Gofmt fix Gofmt fix
This commit is contained in:
parent
31f70d4394
commit
f124f38563
2 changed files with 14 additions and 0 deletions
13
restapi.go
13
restapi.go
|
@ -693,6 +693,19 @@ func (s *Session) GuildBanCreate(guildID, userID string, days int) (err error) {
|
||||||
return s.GuildBanCreateWithReason(guildID, userID, "", days)
|
return s.GuildBanCreateWithReason(guildID, userID, "", days)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GuildBan finds ban by given guild and user id and returns GuildBan structure
|
||||||
|
func (s *Session) GuildBan(guildID, userID string) (st *GuildBan, err error) {
|
||||||
|
|
||||||
|
body, err := s.RequestWithBucketID("GET", EndpointGuildBan(guildID, userID), nil, EndpointGuildBan(guildID, userID))
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = unmarshal(body, &st)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// GuildBanCreateWithReason bans the given user from the given guild also providing a reaso.
|
// GuildBanCreateWithReason bans the given user from the given guild also providing a reaso.
|
||||||
// guildID : The ID of a Guild.
|
// guildID : The ID of a Guild.
|
||||||
// userID : The ID of a User
|
// userID : The ID of a User
|
||||||
|
|
|
@ -1253,6 +1253,7 @@ const (
|
||||||
ErrCodeUnknownUser = 10013
|
ErrCodeUnknownUser = 10013
|
||||||
ErrCodeUnknownEmoji = 10014
|
ErrCodeUnknownEmoji = 10014
|
||||||
ErrCodeUnknownWebhook = 10015
|
ErrCodeUnknownWebhook = 10015
|
||||||
|
ErrCodeUnknownBan = 10026
|
||||||
|
|
||||||
ErrCodeBotsCannotUseEndpoint = 20001
|
ErrCodeBotsCannotUseEndpoint = 20001
|
||||||
ErrCodeOnlyBotsCanUseEndpoint = 20002
|
ErrCodeOnlyBotsCanUseEndpoint = 20002
|
||||||
|
|
Loading…
Reference in a new issue