Sources of Telegram bot for cryptopotato chat. https://t.me/devpotato_bot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Vladislav Glinsky 556032a34d
Put back requirements.txt
6 years ago
devpotato_bot Log message deletion errors 6 years ago
tests [roll] Add d% alias for percentile dice (d100) 6 years ago
.dockerignore Added docker-related stuff 6 years ago
.gitignore Added docker-related stuff 6 years ago
Dockerfile Put back requirements.txt 6 years ago
LICENSE Use MIT license 6 years ago
README.md [roll] Add d% alias for percentile dice (d100) 6 years ago
entrypoint.sh Refactoring 6 years ago
requirements.txt Update python-telegram-bot to 12.3.0 6 years ago
setup.py Decorator for caller's message deletion code 6 years ago

README.md

Cryptopotato Telegram Bot

Simple Telegram bot for cryptopotato chat. To use this bot in Telegram, click here.

Requirements

Setup

Bot requires authorization token to be set in BOT_TOKEN environment variable. You can get one from BotFather.

If you want bot send error reports directly to your private messages, set DEVELOPER_IDS environment variable to a comma-separated list of corresponding user ids. You can get yours, for example, from userinfobot (it supports retrieving ids from forwarded messages too, but it works I suppose only when message's author has enabled linking back to their account in forwarded messages privacy settings). This question on SO has more options.

N.B. To receive error reports from bot you have to initiate a conversation with the bot first. For example, by issuing /start command to it in direct messages or unblocking the bot if you blocked it before.

To start bot you have to run specify package name with -m option to Python interpreter:

python -m devpotato_bot

Make sure package devpotato_bot is present in the sys.path (e.g., by adding its parent directory to PYTHONPATH environment variable or by setting working directory to it).

Current Features

Available commands:

  • /me message

    Announces sender's actions to the chat, original message will be deleted if bot has enough permissions in the chat.

    Example: /me hit the wall.

  • /fortune

    Prints a random epigram, requires fortune executable to be present.

  • /ping

    Confirms that bot is currently active by responding with 'pong'.

  • /roll (or /r for short) 🚧 [WIP]

    Make a dice roll in simplified dice notation: AdB+M:

    • A: number of rolls (can be omitted if 1)
    • B: number of sides or % for percentile dice (i.e. d100)
    • M: a modifier that is added to (or subtracted from) roll result ("+" or "-" between B and M defines modifier's sign)
    • A, B and M are integer numbers, A and B are positive.

    Maximum number of rolls is 100, the biggest allowed dice has 120 sides.

  • /produce_error

    Test error reporting to developers' private messages by generating an unhandled exception.

    Is available only to users specified in DEVELOPER_IDS, see Setup section for details.

Planned Features

  • /roll similar to RollEm Telegram Bot 🚧
    • arbitrary chained rolls (4+2d6+d10-d7)
    • exploding rolls (d6! or d10x), where maximum rolled value triggers extra rolls

License

Licensed under the MIT license.