ruz-bot/daemons/bot.py
Administrator c7bb2829f7 logging
2022-10-27 13:06:40 +03:00

21 lines
436 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.process(message)