discordaio.client
¶
Classes¶
DiscordBot
: This class represents a discord bot object, it has many utility methods for making a bot.
-
class
discordaio.client.
DiscordBot
(token: str)[source]¶ This class represents a discord bot object, it has many utility methods for making a bot.
New in version 0.2.0.
-
http
¶ Used for making http requests and websocket creation.
Type: HTTPHandler
-
ws
¶ The websocket used for communication
Type: DiscordWebsocket
Inheritance
-
event
(name: str = None)[source]¶ DiscordBot event decorator, uses the function’s name or the ‘name’ parameter to subscribe to a event
New in version 0.2.0.
-
await
get_channel
(channel_id: int) → discordaio.channel.Channel[source]¶ Gets a channel from it’s id
New in version 0.2.0.
Parameters: channel_id – The channel id
-
await
get_dms
() → List[discordaio.channel.Channel][source]¶ Gets a list of dms.
New in version 0.2.0.
Returns: The DMs channels Return type: list
ofChannel
-
await
get_guild
(guild_id: int) → discordaio.guild.Guild[source]¶ Returns a Guild object from a guild id.
New in version 0.2.0.
Parameters: guild_id ( int
) – The guild idReturns: The requested guild Return type: Guild
-
await
get_guilds
() → List[discordaio.guild.Guild][source]¶ Returns a list of guilds where the bot is in.
New in version 0.2.0.
-
await
get_self_user
() → discordaio.user.User[source]¶ Returns the bot user object. (it’s like get_user(‘@me’))
New in version 0.2.0.
-
await
get_user
(id) → discordaio.user.User[source]¶ Gets the user object from the given user id.
New in version 0.2.0.
Parameters: id ( int
) – The user idReturns: The requested user Return type: User
-
await
move_channels
(guild_id: int, array: List[Tuple[int, int]])[source]¶ Modify the positions of a set of channel objects for the guild.
Note
Requires ‘MANAGE_CHANNELS’ permission. Fires multiple Channel Update events. Only channels to be modified are required, with the minimum being a swap between at least two channels.
Parameters: - guild_id – The id of the guild.
- array – A list of tuples containing (channel_id, position)
-