diff --git a/restapi.go b/restapi.go index b088711..fdbcc35 100644 --- a/restapi.go +++ b/restapi.go @@ -693,6 +693,19 @@ func (s *Session) GuildBanCreate(guildID, userID string, days int) (err error) { 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. // guildID : The ID of a Guild. // userID : The ID of a User diff --git a/structs.go b/structs.go index 91b5002..13eb993 100644 --- a/structs.go +++ b/structs.go @@ -1253,6 +1253,7 @@ const ( ErrCodeUnknownUser = 10013 ErrCodeUnknownEmoji = 10014 ErrCodeUnknownWebhook = 10015 + ErrCodeUnknownBan = 10026 ErrCodeBotsCannotUseEndpoint = 20001 ErrCodeOnlyBotsCanUseEndpoint = 20002