import os
import datetime
import telebot
from telebot import types
bot = telebot.TeleBot('')
class TestTeleBot:
def __init__(self):
self.bot_polling()
@bot.message_handler(commands=['start'])
def start_message(message):
print('-------------------------------------------------------------------')
print(datetime.datetime.fromtimestamp(message.date).strftime('%H:%M:%S %d-%m-%Y'))
print(message.text)
print(message.from_user.id)
print(message.from_user.first_name)
print(message.from_user.last_name)
print(message.from_user.username)
print('-------------------------------------------------------------------')
bot.send_message(message.chat.id, "Здравствуте, что хотите заказать?")
def bot_polling(self):
return bot.polling(none_stop=True)
def main():
testTeleBot = TestTeleBot()
if __name__ == '__main__':
main()