Git Product home page Git Product logo

Snooful

GitHub issues GitHub pull requests Travis (.com)

The most complete bot for moderation, utility, and fun in Reddit Chat.

Optional Dependencies

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 to stdout
  • esrever - reversing (the reverse command) won't account for fancy Unicode things
  • git-last-commit - the most recent commit hash will never be shown in the version command
  • lodash.chunk - some commands (like commands and listfaq) will not be paginated

Configuration

Snooful uses JSON for configuration. This file is located at ./config.json, and must be created manually.

Credentials

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).

Settings Manager

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 by require() 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.

Prefix

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.

Debugging

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.

Example Config

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

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.

snooful's Projects

snooful icon snooful

The most complete bot for moderation, utility, and fun in Reddit Chat.

sqlite-settings icon sqlite-settings

Stores Snooful settings in a SQLite database, organized by subreddit/group ID.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.