Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 1003 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 1003 Bytes

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