Skip to content

vornao/RandomBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Random Bot

This is a very simple bot that will reply to you with random quotes chosen from a database. Bot will answer in private chat as well as group chats; inline commands are now fully supported! This code has been written using python-telegram-bot library.

CodeGrade CodeScore Code style: black


Requirements:

  • Python 3.9.x
  • pip
  • python-telegram-bot (pip install python-telegram-bot)

Installation instructions:

  • Clone repository or download source files with git clone
  • Rename config.sample.py to config.py and replace values with your own custom configuration
  • Create a bot with @botfather on telegram, then put your new token in config.py file. Keep it a secret.
  • From @BotFather run /setinline to enable inline features and /setcommands in order to let telegram prompt your commands in the chat.
  • From a terminal window now run: python3 main.py & (the & command will leave it in background) or create Unit service for the script from systemd.
  • If everything gone well, the bot is now running!

Bot Usage instructions:

After the bot has started, it will reply to your messages with some random stuff from the database.

  • To add contents, use commands listed in config.py and follow instructions.
  • This bot supports inline commands: type @your_bot_username in any chat to let him prompt you random quotes! (you can also ask for inline specific content, see config.sample.py)
  • You can change bot settings from @BotFather.
  • Further information on Telegram Offical Documentation

🔥 Changelog Ver. 1.3.0 🔥

  • Added toggle for messages in group chats
  • Now with full gif support!
  • Custom replies: make the bot say whaterver you want
  • Schedule message in chats: bot will randomly send message in chat where this function is enabled!