mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-07 12:38:05 +00:00
API: Fixed Ban panicking
This commit is contained in:
parent
712a061e8e
commit
bf7ca8450d
|
@ -176,7 +176,7 @@ func (c *Client) ModifyMember(guildID, userID discord.Snowflake, data ModifyMemb
|
||||||
|
|
||||||
// https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
// https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
||||||
type PruneCountData struct {
|
type PruneCountData struct {
|
||||||
// Days is the number of days to count prune for (1 or more).
|
// Days is the number of days to count prune for (1 or more, default 7).
|
||||||
Days uint `schema:"days"`
|
Days uint `schema:"days"`
|
||||||
// IncludedRoles are the role(s) to include.
|
// IncludedRoles are the role(s) to include.
|
||||||
IncludedRoles []discord.Snowflake `schema:"include_roles,omitempty"`
|
IncludedRoles []discord.Snowflake `schema:"include_roles,omitempty"`
|
||||||
|
@ -209,7 +209,7 @@ func (c *Client) PruneCount(guildID discord.Snowflake, data PruneCountData) (uin
|
||||||
|
|
||||||
// https://discord.com/developers/docs/resources/guild#begin-guild-prune-query-string-params
|
// https://discord.com/developers/docs/resources/guild#begin-guild-prune-query-string-params
|
||||||
type PruneData struct {
|
type PruneData struct {
|
||||||
// Days is the number of days to prune (1 or more).
|
// Days is the number of days to prune (1 or more, default 7).
|
||||||
Days uint `schema:"days"`
|
Days uint `schema:"days"`
|
||||||
// ReturnCount specifies whether 'pruned' is returned. Discouraged for
|
// ReturnCount specifies whether 'pruned' is returned. Discouraged for
|
||||||
// large guilds.
|
// large guilds.
|
||||||
|
@ -289,10 +289,6 @@ type BanData struct {
|
||||||
//
|
//
|
||||||
// Requires the BAN_MEMBERS permission.
|
// Requires the BAN_MEMBERS permission.
|
||||||
func (c *Client) Ban(guildID, userID discord.Snowflake, data BanData) error {
|
func (c *Client) Ban(guildID, userID discord.Snowflake, data BanData) error {
|
||||||
if *data.DeleteDays > 7 {
|
|
||||||
*data.DeleteDays = 7
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.FastRequest(
|
return c.FastRequest(
|
||||||
"PUT",
|
"PUT",
|
||||||
EndpointGuilds+guildID.String()+"/bans/"+userID.String(),
|
EndpointGuilds+guildID.String()+"/bans/"+userID.String(),
|
||||||
|
|
Loading…
Reference in a new issue