Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import telebot
- import const
- #some comments are translations
- bot = telebot.TeleBot(const.token)
- print(bot.get_me())
- bot.send_message("@testhash", "test" + " http://telegra.ph/test-07-22-33 ")
- def log(message, answer):
- print("\n -------")
- from datetime import datetime
- print(datetime.now())
- print("Сообщение от "+ str(message.from_user.first_name) + " " + str(message.from_user.last_name) + ". (id = " + str(message.from_user.id) + ") \n Текст: " + str(message.text))
- print("Ответ: " + answer)
- @bot.message_handler(commands=['help'])
- def handle_text(message):
- bot.send_message(message.from_user.id, "я просто бот") #i'm just a bot
- @bot.message_handler(commands=['new'])
- def handle_text(message):
- bot.send_message(message.from_user.id, "Введите заголовок") . #please enter title
- #wait for message and store answer
- #ask another question
- bot.send_message(message.from_user.id, answer1 + "" + .......) #this should be the answer the bot gives
- '''
- here the bot has to ask for the title of the post and wait for the answer which it has to store in a variable
- '''
- bot.polling(none_stop=True, interval=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement