udf / spoilerobot

The source code for the Spoiler-o-bot, a Telegram spoiler creation bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spoilerobot

The source code for the Spoiler-o-bot, a Telegram spoiler creation bot You can try it out by typing @spoilerobot (inline) in Telegram

Usage

  • Setup PostgreSQL on your system

  • Create a user and database for the bot by becoming the postgres user and executing

    $ createuser spoilerobot
    $ createdb spoilerobot
    $ psql
    postgres=# GRANT ALL PRIVILEGES ON DATABASE spoilerobot TO spoilerobot;
    postgres=# \c spoilerobot postgres
    You are now connected to database "spoilerobot" as user "postgres".
    postgres=# GRANT ALL ON SCHEMA public TO spoilerobot;
    postgres=# \password spoilerobot
    [enter a password for the bot's database user]
    
  • Store this password in the db_pwd environment variable (or modify config.py)

  • Put your bot token in a file called token.txt

  • Edit the environmental variables inside shell.nix

  • Enter development shell with nix-shell

  • Run the bot with python spoilerobot.py

About

The source code for the Spoiler-o-bot, a Telegram spoiler creation bot

License:GNU Affero General Public License v3.0


Languages

Language:Python 97.8%Language:Nix 2.2%