= telebot.TeleBot(cfg.API)
class paying():
token = cfg.tokenQIWI
phone = cfg.phoneQIWI
api = QApi(token=token, phone=phone)
price = 0
comment = api.bill(price)
wel = False
bu = False
mainkey = types.ReplyKeyboardMarkup(resize_keyboard=True)
but1 = types.KeyboardButton("About")
but2 = types.KeyboardButton("Buy")
mainkey.add(but1, but2)
@bot.message_handler(commands=['start'])
def welc(m):
cid = m.chat.id
if cid == cfg.admin:
bot.send_message(cid, "Hello, Admin!", reply_markup=mainkey)
wel=True
else:
bot.send_message(cid, "Welcome!", reply_markup=mainkey)
wel = True
@bot.message_handler(content_types=['text'])
def tet(m):
cid = m.chat.id
if m.chat.type == 'private':
if m.text == 'Buy':
bot.send_message(cid, "what do you want to buy?")
bot.send_message(cid, str(cfg.TOBAP))
bu = True
@bot.message_handler(content_types=['text'])
def sgh(m):
if bu:
bot.send_message(cid, 'What do you wanna buy?')
if m.chat.type == 'private':
numof = int(m.text)
bot.send_message(cid, str(cfg.Price[numof]))
bot.polling()
import ТОВАР ААААААААААААААААААААААААА
красиво, хули
А какие-то ошибки вываливает?
Обсуждают сегодня