-
Notifications
You must be signed in to change notification settings - Fork 0
xander_plugin api
The Xander plugin API is defined to help access methods and variables stored in bot.py
. Below are some of the defined bindings.
Config is a module that holds all Xander configurations. It is written in Python for simplicity and compatibility with Python. (Exact definitions in config.py
)
A function that prints line
to the terminal with a timestamp and saves the message to log.txt
. It returns nothing.
A function that can be used to create moderator logs in the modlog
channel defined in config.py
. string
is the message that is sent to the modlog
channel by the bot. message
is the message variable of the moderated message. (message
is required because it is used to differentiate servers) When delete
is True
the message referenced by message
is deleted after sending string
to the modlog channel.
client
is the client object of the bot. More information at https://discordpy.readthedocs.io/en/stable/api.html#discord.Client.
help_menu
is the help menu dictionary. It can be interacted with by plugins to add help entries for them. help_menu_edit
which is listed later can be used to add entries to this.
The voice client object of the bot if it is connected to a voice channel. Equals None
if not connected to a channel. Check https://discordpy.readthedocs.io/en/stable/api.html?highlight=voice%20client#discord.VoiceClient to see how a voice client object works. Only keeps track of one voice client.
Get the variable associated with a keyword from the bot.py
file.
Add a help menu entry for the plugin under the name feature_name
and with the information provided in info
.
Join a voice channel passed in channel
. This passes the current voice client into voice_client
. If connected already this method does nothing. (Does nothing on Guilded)
Leave the currently connected voice channel. Clears voice_client
. If not connected this method does nothing. (Does nothing on Guilded)