Merge branch 'bans' into develop
This commit is contained in:
commit
db77e987e9
1 changed files with 13 additions and 2 deletions
15
restapi.go
15
restapi.go
|
@ -275,15 +275,26 @@ func (s *Session) GuildBans(guildID string) (st []User, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// GuildBanAdd bans the given user from the given guild.
|
||||
// GuildBanCreate bans the given user from the given guild.
|
||||
// guildID : The ID of a Guild.
|
||||
// userID : The ID of a User
|
||||
func (s *Session) GuildBanAdd(guildID, userID string) (err error) {
|
||||
func (s *Session) GuildBanCreate(guildID, userID string) (err error) {
|
||||
|
||||
_, err = s.Request("PUT", GUILD_BAN(guildID, userID), nil)
|
||||
return
|
||||
}
|
||||
|
||||
// GuildBanCreateAndDeleteComments bans the given user from the given guild
|
||||
// and deletes all of their comments younger than a number of days.
|
||||
// guildID : The ID of a Guild.
|
||||
// userID : The ID of a User
|
||||
// days : The number of days of comments to delete
|
||||
func (s *Session) GuildBanCreateAndDeleteComments(guildID, userID string, days int) (err error) {
|
||||
|
||||
_, err = s.Request("PUT", fmt.Sprintf("%s?delete-message-days=%d", GUILD_BAN(guildID, userID), days), nil)
|
||||
return
|
||||
}
|
||||
|
||||
// GuildBanDelete removes the given user from the guild bans
|
||||
// guildID : The ID of a Guild.
|
||||
// userID : The ID of a User
|
||||
|
|
Loading…
Reference in a new issue