Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import telebot
- from telebot import types
- from flask import Flask, request
- bot = telebot.TeleBot("TOKEN")
- server = Flask(__name__)
- TOKEN = 'TOKEN'
- @server.route('/' + TOKEN, methods=['POST'])
- def getMessage():
- bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode("utf-8"))])
- return "!", 200
- @server.route("/")
- def webhook():
- bot.remove_webhook()
- bot.set_webhook(url='https://quiet-lake-27894.herokuapp.com/' + TOKEN)
- return "!", 200
- if __name__ == "__main__":
- server.run(host="0.0.0.0", port=int(os.environ.get('PORT', 5000)))
- @bot.message_handler(commands=['start'])
- def start(m):
- gif = 'CgACAgQAAxkBAAIBM15OxkUofuioKz0XxMs10xdgceZGAAI7BgACnfd4Ul_T32ps-cQOGAQ'
- kb = types.InlineKeyboardMarkup()
- kb.add(types.InlineKeyboardButton(text="קהילה 👨🏽💻", url='https://t.me/GanKasom'))
- kb.add(types.InlineKeyboardButton(text='מגדלים 🧑🏽🌾', url='https://t.me/GanKasomGrow'))
- kb.add(types.InlineKeyboardButton(text='יד שנייה 📦', url='https://t.me/GanKasomExchange'))
- kb.add(types.InlineKeyboardButton(text='כיוונים 📍', url='https://t.me/GanKasomCivonim'))
- kb.add(types.InlineKeyboardButton(text='ביקורות 💭', url='https://t.me/GanKasomReviews'))
- kb.add(types.InlineKeyboardButton(text='בוט ביקורות 📝', url='https://t.me/GanKasomReviews'))
- bot.send_document(m.chat.id, gif, reply_markup = kb)
- def keyboard():
- markup = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
- btn1 = types.KeyboardButton('בוט הגזע')
- markup.add(btn1)
- return markup
- if __name__ == '__main__':
- bot.polling(none_stop=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement