To run an instance of this bot:
- Clone this repository:
run git clone git@github.com:RobinSikkens/Sticky-bot
- Create a virtualenv:
run python3.6 -m venv virtualenv
- Activate the virtualenv:
run source virtualenv/bin/activate
- 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
.
- 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
.
- Start the bot with the virtualenv active:
run runbot
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 tosqlite:///database.sqlite3
. -
STICKORD_LOGLEVEL
determines the minimum level of log messages to be written to the logfilebot.log
. Can be set to eitherDEBUG
,INFO
(default),WARNING
,ERROR
, orCRITICAL
. -
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 toINFO
,WARNING
(default),ERROR
, orCRITICAL
. Discord rate limits webhooks, do not set the level toDEBUG
, 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.