Skip to content

Latest commit

 

History

History
80 lines (50 loc) · 2.26 KB

File metadata and controls

80 lines (50 loc) · 2.26 KB

bans

list

Returns a list of ban objects for the users banned from this guild

params

field type description
limit? integer number of users to return (up to maximum 1000)
before? user id consider only users before given user id
after? user id consider only users after given user id
await discord.bans.list('GUILD_ID', params? /* see above */)

Returns #ban[]

get

Returns a ban object for the given user or errors if the ban cannot be found

await discord.bans.get('GUILD_ID', 'USER_ID')

Returns #ban

create

Create a guild ban, and optionally delete previous messages sent by the banned user

field type description
delete_message_days? integer number of days to delete messages for (0-7) - deprecated
delete_message_seconds? integer number of seconds to delete messages for, between 0 and 604800 (7 days)
await discord.bans.create('GUILD_ID', 'USER_ID', options? /* see above */)

Returns #ban

remove

Remove the ban for a user

await discord.bans.remove('GUILD_ID', 'USER_ID')

Returns void

classes

Ban

Fields

fieldtypedescription
reasonstring | null | neverReason for the ban - never when ban is returned from ban.create
userUser | { id: Snowflake}The banned user - only has id if ban is returned from ban.create
guild_idSnowflakeThe id of the guild that the user is banned in

Methods

Get

Gets this ban and updates this class

await ban.get()

Remove

Removes this ban

await ban.remove()