Advertisement
BLucky_pb

My Code

Jul 22nd, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.21 KB | None | 0 0
  1. import telebot
  2. import const
  3.  
  4.  
  5. #some comments are translations
  6.  
  7. bot = telebot.TeleBot(const.token)
  8.  
  9. print(bot.get_me())
  10.  
  11. bot.send_message("@testhash", "test" + "  http://telegra.ph/test-07-22-33  ")
  12.  
  13.  
  14.  
  15.  
  16. def log(message, answer):
  17.     print("\n -------")
  18.     from datetime import datetime
  19.     print(datetime.now())
  20.     print("Сообщение от "+ str(message.from_user.first_name) + " " + str(message.from_user.last_name) + ". (id = " + str(message.from_user.id) + ")  \n Текст: " + str(message.text))
  21.     print("Ответ: " + answer)
  22.  
  23.  
  24. @bot.message_handler(commands=['help'])
  25. def handle_text(message):
  26.     bot.send_message(message.from_user.id, "я просто бот") #i'm just a bot
  27.  
  28. @bot.message_handler(commands=['new'])
  29. def handle_text(message):
  30.     bot.send_message(message.from_user.id, "Введите заголовок") . #please enter title
  31.     #wait for message and store answer
  32.     #ask another question
  33.     bot.send_message(message.from_user.id, answer1 + "" + .......)   #this should be the answer the bot gives
  34.  
  35. '''
  36. 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
  37. '''
  38.  
  39. bot.polling(none_stop=True, interval=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement