discord.consumer module

class discord.consumer.Consumer(token)[source]

Bases: object

An interface for discord’s REST api as described here: https://discordapp.com/developers/docs/reference

Parameters:token – The bot token.
ENDPOINT = 'https://discordapp.com/api/'
CREATE_MESSAGE_ROUTE = 'channels/%s/messages'
LIST_GUILD_MEMBERS_ROUTE = 'guilds/%s/members'
LIST_GUILD_INVITES_ROUTE = 'guilds/%s/invites'
URL = 'https://github.com/DataScienceDiscord/Charlotte'
NAME = 'Charlotte'
VERSION = 0.1
create_message(message)[source]

Posts a message to the CREATE_MESSAGE route.

Parameters:message – The Message to be sent.
list_guild_members(guild_id, limit=1000)[source]

Gets a list of the guild members.

Parameters:
  • guild_id – The guild whose members we want.
  • limit – The number of members to get.
list_guild_invites(guild_id)[source]

Gets a list of the active guild invites.

Parameters:guild_id – The guild whose invites we want.