wrapper¶
Submodules¶
wrapper.bot module¶
-
class
wrapper.bot.Bot(token: str, public_key: str, *, intents: int = 0)¶ Bases:
objectA class for discord bots.
Parameters
- tokenstr
The token for the bot.
- intentsint
The priveliged intents.
- public_keystr
The public key of the bot.
-
async
close()¶ - Function
The function to close the websocket connection.
-
create_slash(name: str, description: str = 'A command', callback={'content': 'hi', 'tts': False})¶ A function to create a slash command.
- namestr
The name of the slash cmd.
- descriptionstr
The description of the slash cmd.
- callback
The callback of the slash command when its called.
-
db_insert(name: str, callback, public_key: str)¶
-
async
fetch_channel(id: int)¶ - function
A function to fetch a channel.
Note
This is an API call, not from the bots cache.
-
async
get_guild_data()¶ - function
A function to get the bot’s guild data.
-
async
get_user_data()¶ - function
A function to get the bot’s user data.
-
init()¶ - Function
This function initializes the bot to have its attributes.
-
run()¶ - Function
A function to run the bot.
Warning
This is a blocking function, so if you try to run any code after this function, it won’t run.
-
class
wrapper.bot.Document(connection, document_name)¶ Bases:
object-
async
delete(id)¶
-
async
delete_by_id(id)¶
-
async
find(id)¶
-
async
find_by_id(id)¶
-
property
get_all¶
-
async
get_by_id(id)¶
-
async
increment(id, amount, field)¶
-
async
insert(dict)¶
-
async
unset(dict)¶
-
async
update(dict)¶
-
async
update_by_id(dict)¶
-
async
upsert(dict)¶
-
async
wrapper.channel module¶
wrapper.content module¶
wrapper.embed module¶
wrapper.gateway module¶
-
class
wrapper.gateway.Gateway(bot)¶ Bases:
object-
connect(token: str, intents: int)¶ The actual function to connect the bot to discord.
- tokenstr
The token of the bot.
- intentsint
The intents for the bot.
-
async
get_data()¶
-
identify_json(token: str, intents: int)¶ The identify payload to authorize the bot.
- tokenstr
The token of the bot.
- intentsint
The intents for the bot.
-
async
start(_token: str, _intents: int)¶ Function to connect the bot to discord.
- _tokenstr
The token of the bot.
- _intentsint
The intents for the bot.
-
-
exception
wrapper.gateway.InvokeError(message)¶ Bases:
Exception
wrapper.guild module¶
-
class
wrapper.guild.Guild(data={'approximate_member_count': 0, 'features': ['null'], 'id': '444', 'name': 'null', 'owner_id': '888', 'roles': [{'id': '2909267986263572999', 'name': '@everyone', 'permissions': '49794752', 'position': '100', 'color': '0', 'hoist': False, 'managed': False, 'mentionable': False}]})¶ Bases:
object-
snowflake_time(id: int) → datetime.datetime¶
-
wrapper.http_client module¶
-
class
wrapper.http_client.HTTPClient(token: str)¶ Bases:
objectRepresents an http client sending requests to discord.
-
async
delete(endpoint, **kwargs)¶
-
async
fetch_message(channel_id: int, message_id: int)¶ Fetches a channel from discord.
- channel_idint
The channel id to fetch.
- message_idint
The message id to fetch.
-
async
get(endpoint, **kwargs)¶
-
async
patch(endpoint, **kwargs)¶
-
async
post(endpoint, **kwargs)¶
-
async
put(endpoint, **kwargs)¶
-
async
send_message(channel_id=None, content=None)¶ Sends a message to discord.
-
async