Discord setup

The following page will provide an easy-to-follow overview on how to install and run SlugBot in your Discord server or Twitch chat, and how to get the most out of it. Any underlined command can be clicked to view extra information on it. e.g.


Streamers and Stream Notifications

SlugBot intergrates with Twitch.tv allowing it to notify when your selected streamers go live. After specifying your streams channel using and adding some streamers to look out for using , SlugBot will send a notification message to the streams channel when those streamers go live. SlugBot will also delete the notification when the stream goes offline.

Set a Stream Channel for SlugBot to Use

First you’ll want to set a channel in your server for SlugBot to send stream notifications in. Use the command with the streams argument in the channel you want SlugBot to use.

Add Streamers to the Streamer List

This can be done in a couple ways, using the command or using a streamer role.

The linking process is done using the command !twitch <your twitch name>. This link need only be made once per discord account.

One benefit of using the streamer role method is that it works synergisticly with the command - allowing the streamer role to be self-assigned by members of your server. Make the streamer role self-assignable using the command !giveme add <streamer role name>. Members can then use the command !giveme <streamer role> to assign the role to themselves and have their streams appear in the streams channel.

Setting Channels For SlugBot to Use

SlugBot needs to know what channels to use for Welcome Messages, Member Events, Stream Notifications, Leaderboard, and Logging. Use the !setchannel command to see what channels you need to set and what channels have been set already.

Use !setchannel default in the channel you want SlugBot to use to set that channel as the default channel (#general is a good choice).

Do the same for !setchannel leaderboard, !setchannel streams, !setchannel memberevents, and !setchannel log. Make sure the channel permissions are as you want them; The logging channel should be private and only visible to moderators, for example.

A set channel can be unset using !setchannel <channel> reset.

Setting Roles For SlugBot to Use

Use the command to see what roles can be set for SlugBot’s use. You will want to create the roles you plan for SlugBot to use first, then set them using !setrole <role to set> <role name>. For example, create a role in Server Settings called ‘Newcomer’ and assign it as the global role with !setrole global newcomer.

Setting Roles to be Given when a Member Reaches a Certain Level

SlugBot can be used to give members roles to members who have been active in the server and reached a specific level. This can be done using the !roleatlevel command. To add a role to be given at level use the format !roleatlevel add <role> <level> [sendNotification?]. The optional argument sendnotification requires either true or false to state whether a notification should be sent telling the member they have gained the role upon reaching the required level.

Example: !roleatlevel add Trusted 10 true

To stop a role being given at a level, use the following format: !roleatlevel remove <role name>. ​ ​

Miscellaneous Settings

The welcome message sent by SlugBot when a new member joins can be customised using the !setwelcomemessage <your welcome message> command. Any instance of ${member} in the welcome message will be replaced with the display name of the new member.

You may have role pings enabled but also want to give members the option to opt out of receiving said pings. Use the command to toggle whether to allow members to opt out of role pings.

SlugBots command prefix can be set using .


Twitch Setup

To get SlugBot in your twitch chat, use the command /twitch in any Discord server with SlugBot. You will then receive a message with instructions on how to complete the account link process. Once you’ve linked your accounts, SlugBot will then be lurking in your twitch chat until activation - use the command !activate slugbot to get it listening to commands and enable all SlugBot functionality.

Modules and Permissions

To enable/disable individual commands, use the !permissions <command> <enable|disable>. For example, to disable the !uptime command, use the following command !permissions uptime disable.


Flag Replacers

Some SlugBot functions allow users to set strings to be used for responses such as custom welcome messages and command responses. These strings can be made more dynamic with the use of flag replacers.

${NAME}

Any appearance of this flag in the string will be replaced with the name of the user who triggered the function.

${ID}

Any appearance of this flag in the string will be replaced with the ID of the user who triggered the function.

${COUNT}

Any appearance of this flag in the string will be replaced with the number of times the function has been triggered. If used for a welcome message, the flag will be replaced with the server’s member count instead.

${ARG:0} ${ARG:1} ${ARG:2}

Index flags, when used for command responses, will be replaced by the corresponding argument that was supplied when the command was used.

${MATCH} ${MATCH: 1} ${MATCH: 2}

For RegEx custom commands, this flag will be replaced by the match that triggered it. If an index argument is given, the flag will be replaced by the corresponding capture group in the given regEx. ${MATCH: 0} will always be replaced by the full regEx match.

${VALUE}

Any appearance of this flag in the string, when used for command responses, will be replaced with a stored value that can be set, incremented, and decremented by supplying a number argument, ++, or – respectively when the command was used.

${SETVALUE: }

This flag will save a string to the command that called it. The string can then be added to the response with ${VALUE}. This gives commands some persistent memory. The flag is removed from the response.

${RESTRICT: #<channel id>} ${RESTRICT: @<member id>}

This flag restricts the use of the function to either within specified channels, or by specified members. Multiple channel and member restrictions can be listed. The member must satisfy at least one of each restriction type listed. The flag is removed from the response.

${REACT: <emoji>}

This flag will add the specified emoji as a reaction to the message that triggered the function. The flag is removed from the response.

${RAND: <option 1> | <option 2> | <option 3> | …}

Any appearance of this flag in the string will be replaced with one of the listed options selected at random. The option selection can be weighted by prefixing the option with {<weight>} - for example ${RAND: {2} heads | {1} tails}. This will make the option “heads” be twice as likely to be selected.

${IF: {<logic expression>} <option 1> | <option 2> }

This flag will attempt to resolve the given <logic expression> to either TRUE or FALSE. If true, <option 1> will replace the flag - otherwise <option 2> will replace the flag. Replacer flags can be nested within the logic expression and/or the options.

${MATH: <expression>}

This flag will be replaced by the result of evaluating the expression given. Other replacer flags can be nested within this flag and factored into the expression - for example ${MATH: ${COUNT} + 10}.

${CALL: <command> [arg0 [arg1 […]]]}

This replacer flag will replace itself with the response of the given command. This essentially turns commands into functions. The arguments passed in can be referenced in the called command’s response with ${ARG: <arg index>}

${CALLONLY}

If this flag is present in the response of a command, that command can only be used through ${CALL: } and by no other means.

${TIMEOUT: <duration>}

This flag will timeout the user who triggered the function for <duration> seconds if possible. This flag only applies for Twitch functions. SlugBot must be a moderator in the relevant Twitch chat. The flag is removed from the response.

${MUTE: <duration>}

This flag will mute the user who triggered the function for <duration> seconds if possible. This flag only applies for Discord functions. Slugbot must have the ability to apply roles. The flag is removed from the response.

${DELETE}

This flag will delete the message that triggered the response with this flag in it. This flag only applies for Discord functions. Slugbot must have the ability to delete messages. The flag is removed from the response.

${DELETESELF: <time>}

This flag will delete the command response sent by SlugBot after the specified amount of time (in seconds). If no time is given, the default is 10 seconds. This flag only applies for Discord functions. Slugbot must have the ability to delete messages. The flag is removed from the response.