Skip to content

A trivia bot to get random quizzes in private chat or in groups with a ranking system.

License

Notifications You must be signed in to change notification settings

Kekko01/Trivia-Bot-Telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Triva Bot Telegram

A trivia bot to get random quizzes in private chat or in groups with a ranking system.

GitHub issues GitHub forks GitHub stars GitHub license Twitter

What is it?

Trivia Bot send quiz to chat (groups or personal chats) and if someone answers correctly, add a point. Also, can send a ranking with all members group with the points accumulated.

How to clone bot and setup

  1. Download bot files from: https://github.com/Kekko01/Trivia-Bot-Telegram/archive/refs/heads/main.zip

  2. Extract it and open folder

  3. Create file named credentials.py with the DB credentials and Telegram Token:

    telegram_token = "" # Telegram Bot Token
    db_host = ""        # Database host name
    db_name = ""        # Database database name
    db_user = ""        # Database user name
    db_password = ""    # Database user password
  4. Create a MySQL DB o similar like MariaDB, and start this query in the database:

    CREATE TABLE `ranking` (
    `user_id` bigint NOT NULL,
    `chat_id` bigint NOT NULL,
    `username` varchar(50) NOT NULL,
    `date` datetime NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  5. Install dependencies:

    pip install -r requirements.txt
  6. Start the bot:

    python bot.py

FAQ

How to install Python?

Go here: https://www.python.org/downloads/ and install the verson for yout PC

How to install a MySQL DB?

You can install for example XAMPP

How to create a Telegram Bot?

Telegram Official Guide: https://core.telegram.org/bots#3-how-do-i-create-a-bot

There are commands?

Yes, there are commands:

start - Start the bot
quiz - Send a quiz
help - Send help message
ranking - Send the ranking of the chat
points - Send the sum of your points
vote - Vote the bot in BotsArchive
code - Project's GitHub Page

Have you problems?

Don't worry, please you can found or create a issue here: https://github.com/Kekko01/Trivia-Bot-Telegram/issues

About

A trivia bot to get random quizzes in private chat or in groups with a ranking system.

Topics

Resources

License

Stars

Watchers

Forks

Languages