class documentation

class Bot(discord.Client):

View In Hierarchy

The bot class inherits from discord.Client :guidsId: a set of all guilds id the bot is in :guildsDict: a dict of all guildData the bot is in, with the guild id as key :tldrLoop: the loop for the tldr command :moodLoop: the loop for the mood command :socialGraphLoop: the loop for the social graph command :autoModLoop: the loop for the auto mod command :moodUpdates: a list of list of tuples (guildId, updateType) where updateType is True for refresh and False for reset :moodUpdateMinute: the current minute of the "clock" used to know when to update the moods :socialGraphWorker: the worker for the social graph command

Method __init__ Constructor :param args: :param kwargs:
Async Method fetch_reaction Fetches the reaction of the consent message :return: None
Method fetchHistoryBefore Fetches the history of a channel before a specific message :param channel: channel to fetch the history from :param limit: limit of messages to fetch :param message: message to fetch the history before :return: the history...
Method fetchMessage Fetches a message from a channel :param channel: channel to fetch the message from :param messageId: id of the message to fetch :return: the message
Async Method guild_added Called when the bot joins a guild :param guild: The guild the bot joined :return: None
Async Method guild_removed Called when the bot leaves a guild :param guildId: The id of the guild the bot left :return: None
Async Method initialise_social_graphs Loads the social graphs from a json file and initialises the social graph worker :return: None
Async Method on_guild_join Called when the bot joins a guild :param guild: The guild the bot joined :return: None
Async Method on_guild_remove Called when the bot leaves a guild :param guild: The guild the bot left :return: None
Async Method on_message Called when a message is sent in a channel the bot can see :param message: The message sent :return: None
Async Method on_message_edit Called when a message is edited :param before: The message before it was edited :param after: The message after it was edited :return: None
Async Method on_raw_reaction_add Called when a reaction is added :param payload: The payload of the reaction :return: None
Async Method on_raw_reaction_remove Called when a reaction is removed :param payload: The payload of the reaction :return: None
Async Method on_ready Called when the bot is ready :return: None
Method reply_message Sends a messages to a specific channel :param content: textual content of the message :param message: message to reply to
Method save Undocumented
Method send_message Sends a messages to a specific channel :param content: textual content of the message :param channel: channel to send the message in
Method timeLoop Keeps track of time and calls the functions that need to be called every minute
Instance Variable autoModLoop Undocumented
Instance Variable guildsDict Undocumented
Instance Variable guildsId Undocumented
Instance Variable moodLoop Undocumented
Instance Variable moodUpdateMinute Undocumented
Instance Variable moodUpdates Undocumented
Instance Variable socialGraphLoop Undocumented
Instance Variable socialGraphWorker Undocumented
Instance Variable tldrLoop Undocumented
def __init__(self, *args, **kwargs):

Constructor :param args: :param kwargs:

async def fetch_reaction(self):

Fetches the reaction of the consent message :return: None

def fetchHistoryBefore(self, channel, limit, message):

Fetches the history of a channel before a specific message :param channel: channel to fetch the history from :param limit: limit of messages to fetch :param message: message to fetch the history before :return: the history

def fetchMessage(self, channel, messageId):

Fetches a message from a channel :param channel: channel to fetch the message from :param messageId: id of the message to fetch :return: the message

Parameters
channel:discord.TextChannelUndocumented
messageIdUndocumented
Returns
discord.MessageUndocumented
async def guild_added(self, guild):

Called when the bot joins a guild :param guild: The guild the bot joined :return: None

async def guild_removed(self, guildId):

Called when the bot leaves a guild :param guildId: The id of the guild the bot left :return: None

async def initialise_social_graphs(self):

Loads the social graphs from a json file and initialises the social graph worker :return: None

async def on_guild_join(self, guild):

Called when the bot joins a guild :param guild: The guild the bot joined :return: None

async def on_guild_remove(self, guild):

Called when the bot leaves a guild :param guild: The guild the bot left :return: None

async def on_message(self, message):

Called when a message is sent in a channel the bot can see :param message: The message sent :return: None

async def on_message_edit(self, before, after):

Called when a message is edited :param before: The message before it was edited :param after: The message after it was edited :return: None

async def on_raw_reaction_add(self, payload):

Called when a reaction is added :param payload: The payload of the reaction :return: None

async def on_raw_reaction_remove(self, payload):

Called when a reaction is removed :param payload: The payload of the reaction :return: None

async def on_ready(self):

Called when the bot is ready :return: None

def reply_message(self, content, message):

Sends a messages to a specific channel :param content: textual content of the message :param message: message to reply to

Parameters
content:strUndocumented
message:discord.MessageUndocumented
def save(self):

Undocumented

def send_message(self, content, channel):

Sends a messages to a specific channel :param content: textual content of the message :param channel: channel to send the message in

Parameters
content:strUndocumented
channel:discord.TextChannelUndocumented
def timeLoop(self):

Keeps track of time and calls the functions that need to be called every minute

autoModLoop =

Undocumented

guildsDict =

Undocumented

guildsId =

Undocumented

moodLoop =

Undocumented

moodUpdateMinute =

Undocumented

moodUpdates: list[list[tuple[int, bool]]] =

Undocumented

socialGraphLoop =

Undocumented

socialGraphWorker =

Undocumented

tldrLoop =

Undocumented