Discord module
The Discord module is an importable module that allows you to interact with Discord. To use it, import it like this:
send(message: string)
Sends a text message in Discord. You can send up to 5 messages per custom function. You can also use this to mention people, but @everyone and @here and mentioning roles will not work.
run(command: string)
Runs an OcelotBOT command as if the user running the custom function had run it. The command is run in the context of the triggering message, as if the user that triggered the function and will send the output into the channel. Some commands can't be run inside a custom command, and some commands may not act as expected.
Commands do not have to contain the prefix to work, including the prefix will still work but if you change the prefix after the fact the custom command will need to be updated.
runWithSettings(command: string, settings: table)
Runs an OcelotBOT command with specific settings. This is an advanced function that will allow you to customise OcelotBOT command responses beyond what is possible normally. For a list of possible uses, check the Command Settings page.
playAudio(url: string)
Plays a single audio track, can be a YouTube URL or any audio file or stream. Can always be stopped with !music stop, and will not interrupt currently playing music or guessing games. Joins the voice channel the triggering user is in.
paginate(pages: string[])
Paginate uses OcelotBOT's standard reaction-based pagination, to display each page in pages
as a separate message.
react(emoji: string)
Reacts to the trigger message with the specified emoji ID.
To get the emoji ID, type a backslash (\) then the emoji you want and send it in Discord. You will see something like this: <:yikes:813555460598267924>
The ID is the number, so "813555460598267924" in this case.
webhook(message: string, username: string, avatar: string)
Allows you to send a message as a webhook, with a specific username and avatar.
Last updated