FoofyFox Sandstorm 2
General-purpose Discord bot in C++
FoofyFox Sandstorm 2

Synopsis

FoofyFox Sandstorm 2 is a general-purpose Discord bot, primarily responding to textual commands. A music player feature, where users upload their music in the form of .mp3 files, is also provided.

Users are to enter a command with the following syntax to activate the functions of the bot:

[command_switch][command] [args]

Each parameter is specified below:

  • command_switch: one-character switch, with a default value '-'.
  • command: a command that is registered with the bot.
  • args: arguments to the command, separated by spaces. "" and '' delimiters are allowed.

An extended Backus-Naur form for the implemented Sandstorm language is provided below:

<S> ::= <command_switch> <command> " " <args>
<command_switch> ::= "-"
<command> ::= [a-zA-Z0-9\"\']+
<args> ::= [a-zA-Z0-9\"\']+

Do note that for quotes ('\'' or '"'), these are checked, context-sensitive, by helper functions in ffss::SSUtility and are not represented in the language above.

Running the bot

The bot can be started with a minimum of the following command:

sandstorm [TOKEN]

Where the token must be provided.

Other options are avaliable as follows:

--help display this help and exit
--cmdswitch the switch for a command, say '-' for '-command'. Only the first character is taken, all other characters ignored.
--readbufsize set the size of the read buffer to load files into memory on program start
--helpfile location of the help file to display on a '-help' command
--fortunefile location of the file to generate fortune teller messages, each message separated by a newline
--laughmax maximum number of 'HA's for the '-laugh' command
--defaultimg image to reply to a user entering only '-'
--fenndir directory to look for fennec images for the '-fennec' command
--audioqueuemax maximum items in the audio queue
--argsmax maximum number of arguments, including the '-command', that can be parsed