ClientCompoundGuildBanEndpoints
Methods
()
__new__Compound components do not support instancing.
Sub-typing is supported, but the attributes are only proxied. Sub-types have no meaning by themselves.
Raises
RuntimeError
(guild, user, ...)
guild_ban_addBans the given user from the guild.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
guild |
| The guild from where the user will be banned. | |||
user |
| The user to ban from the guild. | |||
delete_message_duration |
|
| How much seconds back the user's messages should be deleted. Can be in range [0:604800]. | ||
reason |
|
| Shows up at the guild's audit logs. |
Raises
TypeError
- If
guild
was not given neither asGuild
norint
. - If
user
was not given neither asClientUserBase
, norint
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(guild, user, ...)
guild_ban_deleteUnbans the user from the given guild.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
guild |
| The guild from where the user will be unbanned. | |||
user |
| The user to unban at the guild. | |||
reason |
|
| Shows up at the guild's audit logs. |
Raises
TypeError
- If
guild
was not given neither asGuild
norint
. - If
user
was not given neither asClientUserBase
, norint
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(guild, user)
guild_ban_getReturns the guild's ban entry for the given user id.
This method is a coroutine.
Parameter | Type | Description |
---|---|---|
guild |
| The guild where the user banned. |
user |
| The user's or their id, who's entry is requested. |
Returns
ban_entry : BanEntry
The ban entry.
Raises
TypeError
- If
guild
was not passed neither asGuild
,int
. - If
user
was not given neither asClientUserBase
,int
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
(guild)
guild_ban_get_allReturns the guild's ban entries.
This method might need multiple requests to complete it's task
This method is a coroutine.
Parameter | Type | Description |
---|---|---|
guild |
| The guild, what's bans will be requested |
Returns
ban_entries : list
of BanEntry
elements
User - reason pairs for each ban entry.
Raises
TypeError
If guild
was not given neither as Guild
, int
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
See Also
.guild_ban_get_chunk
: Getting a chunk of ban entries up to 1000 users.
(guild, ...)
guild_ban_get_chunkReturns a chunk of the guild's ban entries.
This method is a coroutine.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
guild |
| The guild, what's bans will be requested | |||
after |
|
| The timestamp after the banned users were created. | ||
before |
|
| The timestamp before the banned users were created. | ||
limit |
|
| The amount of ban entries to request. Can be in range [0:1000] When given as non-positive (<= 0) defaults to the maximal amount. |
Returns
ban_entries : list
of BanEntry
elements
User, reason pairs for each ban entry.
Raises
TypeError
- If
guild
was not given neither asGuild
,int
. - If
after
,before
was passed with an unexpected type.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
See Also
.guild_ban_get_all
: Getting all ban entries of a guild.