Overlord's Gatekeeper Theme
Template functions

Help › Custom commands › Functions

Template functions

These are the functions people use most. Arguments go after the function name, separated by spaces.

Messages

sendMessage channelID "text"Posts in another channel. Use nil for the current one.
sendDM "text"DMs the person who triggered the command.
deleteTrigger 5 / deleteResponse 30Deletes the triggering message or the bot's reply after that many seconds.
addReactions "๐Ÿ‘" "๐Ÿ‘Ž"Reacts to the triggering message.
cembed / complexMessageBuilds embeds and richer messages. See Custom embeds.

Mentions

By default the bot won't ping roles, @everyone, or @here from a custom command. These functions allow it on purpose:

mentionRoleID roleID / mentionRoleName "Name"Pings a role.
mentionEveryone / mentionHerePings @everyone or @here.

Roles

hasRoleID roleIDTrue if the triggering member has the role. targetHasRoleID userID roleID checks someone else.
addRoleID roleID / removeRoleID roleIDAdds or removes a role on the triggering member.
giveRoleID userID roleID / takeRoleID userID roleIDAdds or removes a role on someone else.

Arguments and members

parseArgs 1 "usage text" (carg "member" "target")Checks and reads command arguments, and shows the usage text if they're wrong.
getMember userIDLooks up a member.

Saving data

dbSet userID "key" value / dbGet userID "key"Stores and reads a value. Use 0 as the user ID for server-wide values.
dbIncr userID "key" 1 / dbDel userID "key"Adds to a stored number, or deletes a value.

Saved values show up under Custom Commands → Database.

Running other commands later

execCC ccID channelID delay dataRuns another custom command, optionally after a delay in seconds.
scheduleUniqueCC ccID channelID delay "key" dataSame, but replaces any earlier schedule with the same key.

Text, numbers, and time

lower, upper, title, joinStr, reFind, randInt, currentTime, and humanizeDurationSeconds cover most everyday needs. sdict, dict, and cslice build maps and lists.

← Syntax and dataCustom embeds →