Skip to content
A modular chat bot for Discord written in Javascript
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src
types
.editorconfig
.gitignore
README-dev.md
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

secret_bot

version 7.3.x

This page is for people who wish to use secret_bot in their own Discord servers. For more development related information, check out README-dev.md.

What is secret_bot?

secret_bot is a modular Discord chat bot written in Node.js.

Commands start with the ~ character, but this can be changed per server (e.g. if there's another bot that uses ~).

It features recursive command processing, so you can chain commands in one message (e.g. ~flip ~fliptable will do ~fliptable then flip it upside-down).

You can also add your own basic commands that will work in your server.

You can restrict secret_bot to certain channels, or let it be used everywhere.

Adding secret_bot to your server

  1. Authorize the bot to join your server. You require the Manage Server permission on your Discord server to be able to do this.
  2. Start using the bot.

That's it, really! No need to do anything else.

Basic setup and use

Clicked the link (here it is again)? Added the bot? Great. First, let's look at some concepts.

Addons

Every command in secret_bot belongs to an addon. Every addon has an unique name, and usually contain commands related to that name.

For example, the commands ~lenny and ~disapprove output ( ͡° ͜ʖ ͡°) and ಠ_ಠ respectively, and are in the faces addon. ~fliptable flips a table, and is in the flipping addon.

Each addon can be enabled and disabled, effectively adding or removing commands from your server. More on that after I explain the default ones.

Default Addons

The groups core, help, and support are always active on your server, and can not be disabled. core has important functions of the bot, so you could really mess things up if you removed it. help allows you to get descriptions for almost every command in the bot. support provides a way for server admins to talk to a human about problems they're having with the bot (more on that later).

By default, the following groups are enabled. These can be disabled if you don't want them.

Group Description Source
emotes A list of Unicode emotes that didn't make their way into faces emotes.json
faces A list of common Unicode emotes, and variations on each faces.json
flip Turns text upside down flip.js
flipping For all your table flipping needs flipping.json
phrases Contains shortcuts for saying a few short phrases phrases.json
summaries Gives information about pasted links summaries.js
util Currently unused. Will have commands like dice rolling and N/A

Some actual commands

~help

~help on its own will give you a small bit of information about the bot. Where ~help is really useful is when you give it another command.

Almost every command in secret_bot has a help entry. Type ~help help to get information about the ~help command. ~help flip will tell you what ~flip does. It's worth checking out a command's ~help page if you don't know what it does. You will often find example commands to help you understand what it does.

~commands, and related commands

~commands will send you a PM (private message) with a list of all commands you can run. The commands it lists depends on where you type it, since different servers can have different groups enabled.

If you put the name of a group after ~commands (such as ~commands core), then it will list all commands for that group.

To find out which group a command is in, use ~which and put the name of the command after (e.g. ~which github). Don't forget you can get help for each command with ~help.

Enabling and Disabling Addons

Don't like the default addons? That's OK. They're designed to give you an idea of what secret_bot can do, but still provide some useful things. Luckily for you, you don't have to use them forever.

To remove an addon from your server, use ~disable-addon and put its name at the end (e.g. ~disable-addon flipping if you don't want table flipping).

Of course, there's a counterpart where you can add commands using ~enable-addon for adding addons. Remember to do ~help enable-addon if you forget how it works.

This is how you add/remove commands that come with bot. You can add your own commands (for in-jokes and other things), which wil be explained in a later section.

Bot configuration

secret_bot uses the tilde ~ at the beginning of commands. If you want to change this, use ~change-prefix then put the prefix you want to use. It doesn't have to be a single character, but it can't contain spaces. If you're feeling magical, you could do ~change-prefix abracadabra-, which means to get help you'd type abracadabra-help.

Soon the colour of secret_bot's messages (well, the line to the left of them) will be able to be changed using ~change-color. If you're trying to keep a colour theme with your bots, this will be useful for you.

Support

Need to actually talk to a human? secret_bot features a support line, where you can talk to an actual person if you encounter a big problem.

Please only use support when it's absolutely necessary. secret_bot is a hobby project, so the time I spend answering support questions is time I could be spending doing far more productive things.

To use the support, type ~support and your reason (e.g. ~support No commands are working, and I don't know what to do!). You will be sent a message with an invite link to join a support channel. To finish a support session, use ~support-close.

Command Chaining

secret_bot allows you to chain commands in one message. For example, ~hundreds ~disapprove will output hundreds, if not thousands, of ಠ_ಠ.

At first, the way secret_bot handles chained commands may seem a little strange, but once you understand it it can be extremely useful. It takes the right-most command, processes it, then gives the output to the 2nd-to-right command.

As a different example, ~flip? ~flip oh no.
The ~flip command (found in the default addon) takes text and flips it upside down.
secret_bot takes the result of ~flip oh no and then feeds it into the previous command: ~flip? ~flip oh no becomes ~flip? ou ɥo.
The ~flip? command (part of flipping) very simply puts (╯°□°)╯︵ before whatever it is given.
That makes the final output (╯°□°)╯︵ ou ɥo.

Adding your own commands

This section covers the basic usage available to server admins. For anything more complex, you'll have to write some code.

The ~add-command command (part of core) allows you to create a simple command for their server. There is also ~remove-command which does what you'd expect.

secret_online: ~add-command example-command this is an example command
<- added ~example-command to server

secret_online: ~example-command
<- this is an example command

secret_online: ~example-command that i wrote
<- this is an example command that i wrote

secret_online: ~remove-command example-command
<- removed ~example-command from server

secret_online: ~example-command
(nothing happens)

There are some special things you can put into the ~add-command command:

Thing What it does
{user} Mentions the user who runs the created command (note: not the person who does ~add-command)
{channel} Mentions the channel the created command is run in
{server} Says the name of the server
{args} Says the text that is put after the final command
secret_online: ~add-command example-command {args} <-- the text is there!
<- added ~example-command to server

secret_online: ~example-command hey, look
<- hey, look <-- the text is there!

secret_online: ~remove-command example-command
<- removed ~example-command from server

secret_online: ~add-command example-command {user} wrote {args} in {channel}
<- added ~example-command to server

secret_online: ~example-command a very long sentence that has very little meaning
<- @secret_online wrote a very long sentence that has very little meaning in #general

secret_online: ~remove-command example-command
<- removed ~example-command from server

Version History (not really important)

I haven't ever had a good versioning system, so numbers are based on major events in the bot's lifetime.

  • 8.x.x
    Added some breaking changes to commands
    Thought I'd bump the version number to reflect that
  • 7.x.x
    Only works on Discord, so it can use Discord features better
    Better addon configuration
  • 6.x.x
    Moved to bot
    Complete rewrite.
    Allow multiple Discord servers
    Abandon bot being module in favour of better Discord support
  • 5.x
    Bot is now a module
    Uses IRCord as a bridge between IRC and Discord
    Now supports Discord
  • 4.x
    Promises.
    Big rewrite of internal logic to work with Promises
  • 3.x
    Moved to secret_bot
    Removed remote web server because of latency
  • 2.x
    Recursive command processing added!
    Was kind-of buggy with async commands
  • 1
    Creation of NMS-irc-bot
You can’t perform that action at this time.