Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1.  
  2.  
  3. @bot.message_handler(commands=['start'])
  4. def start(m):
  5. try:
  6. for i in range (-1,10):
  7. bot.delete_message(m.chat.id,m.message_id+i)
  8. except:
  9. pass
  10. gif = 'CgACAgQAAxkBAAIBM15OxkUofuioKz0XxMs10xdgceZGAAI7BgACnfd4Ul_T32ps-cQOGAQ'
  11. kb = types.InlineKeyboardMarkup()
  12. kb.add(types.InlineKeyboardButton(text='קהילה🧑🏽‍💻', url='https://t.me/GanKasom'‍))
  13. kb.add(types.InlineKeyboardButton(text='מגדלים 🧑🏽‍🌾', url='https://t.me/GanKasomGrow'))
  14. kb.add(types.InlineKeyboardButton(text='יד שנייה 📦', url='https://t.me/GanKasomExchange'))
  15. kb.add(types.InlineKeyboardButton(text='כיוונים', callback_data="כיוונים"'))
  16. kb.add(types.InlineKeyboardButton(text='ביקורות 💭', url='https://t.me/GanKasomReviews'))
  17. kb.add(types.InlineKeyboardButton(text='בוט ביקורות 📝', url='https://t.me/GanKasomReviews'))
  18. bot.send_document(m.chat.id, gif, reply_markup = kb)
  19.  
  20. @bot.callback_query_handler(func=lambda c:True)
  21. def inline(c):
  22. if c.data == 'כיוונים':
  23. key = types.InlineKeyboardMarkup()
  24. but_1 = types.InlineKeyboardButton(text="צפון", callback_data="כיוונים")
  25. key.add(but_1, but_2, but_3)
  26.  
  27.  
  28. @server.route('/' + TOKEN, methods=['POST'])
  29. def getMessage():
  30. bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode("utf-8"))])
  31. return "!", 200
  32.  
  33.  
  34. @server.route("/")
  35. def webhook():
  36. bot.remove_webhook()
  37. bot.set_webhook(url='https://quiet-lake-27894.herokuapp.com/' + TOKEN)
  38. return "Gan Kasom Project ...", 200
  39.  
  40.  
  41. if __name__ == "__main__":
  42. server.run(host="0.0.0.0", port=int(os.environ.get('PORT', 5000)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement