def EN(message):
if (message.text == "EN"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item11 = types.KeyboardButton("Choose category")
item12 = types.KeyboardButton("FAQ")
item13 = types.KeyboardButton("About")
item14 = types.KeyboardButton("Payment instructions")
item15 = types.KeyboardButton("Back")
markup.add(item11,item12,item13,item14,item15)
bot.send_message(message.chat.id,text = "EN", reply_markup=markup)
elif (message.text == "Choose category"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item111 = types.KeyboardButton("History")
item112 = types.KeyboardButton("Science")
item113 = types.KeyboardButton("Arts")
item114 = types.KeyboardButton("Back")
markup.add(item111,item112,item113,item114)
bot.send_message(message.chat.id,text = "Choose category", reply_markup=markup)
elif (message.text == "FAQ"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item122 = types.KeyboardButton("Back")
markup.add(item122)
text = """Text about TOP\-7 questions"""
bot.send_message(message.chat.id,text,parse_mode = 'MarkdownV2',reply_markup=markup)
elif (message.text == "Payment instructions"):
markup = types.InlineKeyboardMarkup()
item141 = types.InlineKeyboardButton("Binance", url = 'https://www.binance.com/en/support/faq/c-2?navId=2')
item142 = types.InlineKeyboardButton("BlockChain",url = 'https://support.blockchain.com/hc/en-us/sections/4517566823060-Deposits-and-Withdrawals')
item143 = types.InlineKeyboardButton("TrustWallet",url = 'https://community.trustwallet.com/t/how-to-create-a-payment-request/23332')
markup.add(item141,item142,item143)
bot.send_message(message.chat.id,text = "Choose your Wallet", reply_markup=markup)
elif (message.text == "Back"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item11 = types.KeyboardButton("Choose category")
item12 = types.KeyboardButton("FAQ")
item13 = types.KeyboardButton("About")
item14 = types.KeyboardButton("Payment instructions")
item15 = types.KeyboardButton("Back")
markup.add(item11,item12,item13,item14,item15)
bot.send_message(message.chat.id,text = "You returned to the menu", reply_markup=markup)
else:
RU(message)
import telebot
from telebot import types
from telegram_bot_pagination import InlineKeyboardPaginator
from texts import arr
token = 'дваопщвгашщпвапвдапукзщелудрпшв'
bot = telebot.TeleBot(token)
@bot.message_handler(func=lambda message:True)
def get_text(message):
send_text_page(message)
@bot.callback_query_handler(func=lambda call: call.texts.split('#')[0]=='text')
def text_page_callback(call):
page = int(call.texts.split('#')[1])
bot.delete_message(call.message.chat.id,call.message.message_id)
send_text_page(call.message,page)
def send_text_page(message,page=1):
paginator = InlineKeyboardPaginator(len(arr),current_page=page,data_pattern='text#{page}')
paginator.add_before(types.InlineKeyboardButton('Like',callback_data='like#{}'.format(page)),types.InlineKeyboardButton('Dislike',callback_data='dislike#{}'.format(page)))
paginator.add_after(types.InlineKeyboardButton('Go Back',callback_data='back'))
bot.send_message(message.chat.id,arr[page-1],reply_markup=paginator.markup)
bot.polling()
def EN(message):
if (message.text == "EN"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item11 = types.KeyboardButton("Choose category")
item12 = types.KeyboardButton("FAQ")
item13 = types.KeyboardButton("About")
item14 = types.KeyboardButton("Payment instructions")
item15 = types.KeyboardButton("Back")
markup.add(item11,item12,item13,item14,item15)
bot.send_message(message.chat.id,text = "EN", reply_markup=markup)
elif (message.text == "Choose category"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item111 = types.KeyboardButton("History")
item112 = types.KeyboardButton("Science")
item113 = types.KeyboardButton("Arts")
item114 = types.KeyboardButton("Back")
markup.add(item111,item112,item113,item114)
bot.send_message(message.chat.id,text = "Choose category", reply_markup=markup)
elif (message.text == "FAQ"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item122 = types.KeyboardButton("Back")
markup.add(item122)
text = """Text about TOP\-7 questions"""
bot.send_message(message.chat.id,text,parse_mode = 'MarkdownV2',reply_markup=markup)
elif (message.text == "Payment instructions"):
markup = types.InlineKeyboardMarkup()
item141 = types.InlineKeyboardButton("Binance", url = 'https://www.binance.com/en/support/faq/c-2?navId=2')
item142 = types.InlineKeyboardButton("BlockChain",url = 'https://support.blockchain.com/hc/en-us/sections/4517566823060-Deposits-and-Withdrawals')
item143 = types.InlineKeyboardButton("TrustWallet",url = 'https://community.trustwallet.com/t/how-to-create-a-payment-request/23332')
markup.add(item141,item142,item143)
bot.send_message(message.chat.id,text = "Choose your Wallet", reply_markup=markup)
elif (message.text == "Back"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item11 = types.KeyboardButton("Choose category")
item12 = types.KeyboardButton("FAQ")
item13 = types.KeyboardButton("About")
item14 = types.KeyboardButton("Payment instructions")
item15 = types.KeyboardButton("Back")
markup.add(item11,item12,item13,item14,item15)
bot.send_message(message.chat.id,text = "You returned to the menu", reply_markup=markup)
elif (message.text == "Science"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item1221 = types.KeyboardButton("Back")
markup.add(item1221)
a = open('extract.txt',"r",encoding="utf-8")
text=a.read()
text1 = '*Use this link for access to the full version of the text*\n'+'*[Binance](https://link.trustwallet.com/send?coin=0&address=bc1q83d2jeh58cv66h6kglr33dgwex6krekdg5uwsa)*'
bot.send_message(message.chat.id,text)
bot.send_message(message.chat.id,text=text1,parse_mode='MarkdownV2')