Skip to content

A bot that talks to the Sticky API, written for discord

License

Notifications You must be signed in to change notification settings

RobinSikkens/Sticky-discord

Repository files navigation

Sticky-discord

To run an instance of this bot:

  1. Clone this repository:

run git clone git@github.com:RobinSikkens/Sticky-bot

  1. Create a virtualenv:

run python3.6 -m venv virtualenv

  1. Activate the virtualenv:

run source virtualenv/bin/activate

  1. Install package and dependencies:

run python setup.py install or python setup.py develop

Optionally, install dev requirements using pip install -r dev_requirements.txt.

  1. Make an env file

make file .env containing token DISCORD_TOKEN= and optionally STICKORD_LOGLEVEL=. For all options, see below.

NOTE: By default, a non-persistent database is used. This means that when your bot shuts down, all database info is lost! If you don't want this, set DATABASE_URL to sqlite:///database.sqlite3.

  1. Start the bot with the virtualenv active:

run runbot

Configuration options

Configuration is currently done using environment variables.

The only required value is DISCORD_TOKEN, as Discord won't let you in without one.

  • DISCORD_TOKEN is, as mentioned, required. It identifies your bot to the Discord servers, and a free token can be generated by going to this page.

  • DATABASE_URL is a database connection URL as used by SQLAlchemy, in the format described on this page. If you don't know or don't care what you're doing, set this to sqlite:///database.sqlite3.

  • STICKORD_LOGLEVEL determines the minimum level of log messages to be written to the logfile bot.log. Can be set to either DEBUG, INFO (default), WARNING, ERROR, or CRITICAL.

  • WOLFRAMALPHA_TOKEN is a non-required token that allows your bot to use WolframAlpha to answer queries asked via the !calc command. A free token can be generated at this page, with a rate limit of 2,000 requests per month.

  • LOGGING_WEBHOOK_URL can contain a Discord-style webhook to use to send urgent log messages to, including tracebacks when a command fails. A webhook can be created by following [this guide][webhook], and the level of messages to send (WEBHOOK_LOGLEVEL) can be set either to INFO, WARNING (default), ERROR, or CRITICAL. Discord rate limits webhooks, do not set the level to DEBUG, as this will fill up very quickly and you won't get a notification.

    Webhook logging is intentionally not using the usual Discord API, as we want the logging to be available without having successfully connected to Discord.

About

A bot that talks to the Sticky API, written for discord

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published