The most complete bot for moderation, utility, and fun in Reddit Chat.
Some dependencies do not need to be installed for Snooful to function, but they do provide some features that will automatically disable if not present. Here is a reference to modules that do this and what changes when they aren't installed:
debug
- replaced with a basic write tostdout
esrever
- reversing (thereverse
command) won't account for fancy Unicode thingsgit-last-commit
- the most recent commit hash will never be shown in theversion
commandlodash.chunk
- some commands (likecommands
andlistfaq
) will not be paginated
Snooful uses JSON for configuration. This file is located at ./config.json
, and must be created manually.
To use Snooful, you must provide credentials, which are taken from snoowrap. The user agent cannot be set as it is automatically set to one containing the version. To get these, go to applications and generate a new app. Fill in the credentials
object of configuration (see the example config for what a script-type config would look like).
Snooful can store data for subreddits and groups. The storage system for this data is decoupled from Snooful itself; instead, a settings manager can be chosen to handle data storage, configured with the settingsManager
config option.
The module can be specified in four ways:
settingsManager.require
(preferred) - A module ID resolvable byrequire()
pointing to the settings manager module.settingsManager.class
- The settings manager class (JavaScript config files only).settingsManager.instance
- An instance of the settings manager (JavaScript config files only).
The options for the settings manager can be specified as well when using the former two options via settingsManager.options
.
Here are some official settings manager modules:
Switching the settings manager does not transfer the existing data. However, you can use a tool to do this yourself.
You can also configure the prefix from the default !
by setting prefix.start
. The prefix is the thing that differentiates a command from a message. Basically, with a prefix of ?
, you must type ?ping
to run the ping
command.
While disabled by default, it is also possible to configure a global prefix at prefix.global
. This prefix works anywhere in a message, and everything after the prefix will be considered an argument to the command.
Please change the prefix if you are hosting your own version of Snooful.
Since this project uses debug
, you can also set the environment variable DEBUG
to snooful:*
to recieve logs of everything notable happening with Snooful. This package also has other environment variables that can be set, which are:
DEBUG_HIDE_DATE
DEBUG_COLORS
DEBUG_DEPTH
DEBUG_SHOW_HIDDEN
These environment variables have no effect if debug
is not installed.
Here is an example configuration:
{
"prefix": {
"start": "?",
"global": "--"
},
"credentials": {
"clientId": "a897d89f89e",
"clientSecret": "0202390301209919219810929012",
"username": "Snooful-Example",
"password": "h0pefully-s3cure"
},
"settingsManager": {
"require": "@snooful/sqlite-settings"
}
}
Commands are stored in the src/commands
folder. They are organized by category. You can add your own command by placing a file ending with .js
in the folder. It must export an object adhering to the comamnd format as seen in the info
command.
Please do not remove the commands in the snooful
category, especially info
and github
.