21 lines
438 B
Python
21 lines
438 B
Python
import os
|
|
|
|
import telebot
|
|
from telebot.types import Message
|
|
|
|
from helpers.mongo import mongo
|
|
|
|
bot = telebot.TeleBot(os.getenv("TELEGRAM_TOKEN"))
|
|
|
|
|
|
@bot.message_handler(commands=['start'])
|
|
def on_start(message: Message):
|
|
mongo.users_collection.delete_many({"chat_id": message.chat.id})
|
|
do_action(message)
|
|
|
|
|
|
@bot.message_handler()
|
|
def do_action(message: Message):
|
|
from helpers.answer import Answer
|
|
Answer(message).process()
|