|
|
6 years ago | |
|---|---|---|
| devpotato_bot | 6 years ago | |
| tests | 6 years ago | |
| .dockerignore | 6 years ago | |
| .gitignore | 6 years ago | |
| Dockerfile | 6 years ago | |
| LICENSE | 6 years ago | |
| README.md | 6 years ago | |
| entrypoint.sh | 6 years ago | |
| requirements.txt | 6 years ago | |
| setup.py | 6 years ago | |
README.md
Cryptopotato Telegram Bot
Simple Telegram bot for cryptopotato chat. To use this bot in Telegram, click here.
Requirements
- Python version 3.6+ (type hints and f-strings are used)
- python-telegram-bot
fortuneexecutable present inPATH
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 messageAnnounces sender's actions to the chat, original message will be deleted if bot has enough permissions in the chat.
Example:
/me hit the wall. -
/fortunePrints a random epigram, requires
fortuneexecutable to be present. -
/pingConfirms that bot is currently active by responding with 'pong'.
-
/roll(or/rfor 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 "-" betweenBandMdefines modifier's sign)A,BandMare integer numbers,AandBare positive.
Maximum number of rolls is 100, the biggest allowed dice has 120 sides.
-
/produce_errorTest 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
/rollsimilar to RollEm Telegram Bot 🚧- arbitrary chained rolls (
4+2d6+d10-d7) - exploding rolls (
d6!ord10x), where maximum rolled value triggers extra rolls
- arbitrary chained rolls (
License
Licensed under the MIT license.