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
¶ HTTPHandler
– Used for making http requests and websocket creation.
-
ws
¶ DiscordWebsocket
– The websocket used for communication
Inheritance
-
await
delete_channel
(channel_id: int) → discordaio.channel.Channel[source]¶ Deletes a channel.
Note
Delete a channel, or close a private message. Requires the ‘MANAGE_CHANNELS’ permission for the guild. Deleting a category does not delete its child channels; they will have their parent_id removed and a Channel Update Gateway event will fire for each of them. Returns a channel object on success. Fires a Channel Delete Gateway event.
New in version 0.2.0.
Parameters: channel_id ( int
) – The channel idReturns: The deleted channel Return type: Channel
-
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 ( int
) – The channel idReturns: The channel Return type: Channel
-
await
get_dms
() → list[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_guild_member
(guild: discordaio.guild.Guild, member_id: int) → discordaio.guild.GuildMember[source]¶ Gets a guild member info for the guild and the member id.
New in version 0.2.0.
Parameters: Returns: The guild member
Return type:
-
await
get_guild_members
(guild: discordaio.guild.Guild)[source]¶ Gets and fills the guild with the members info.
New in version 0.2.0.
Parameters: guild ( Guild
) – The guild to fill the members.
-
await
get_guilds
() → list[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: int) → 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
-