嗨,我想要创建一个机器人来实现亚马逊搜索的自动化,我希望它能非常简单的使用。当您创建一个新的机器人时,我希望它表现得像BotFather一样:
请求Bot名称输入,获取bot名称,要求bot标记输入,获取bot标记,创建bot
我不知道从哪里开始
到目前为止已完成的代码:
keyboard= types.ReplyKeyboardMarkup(row_width=1)
help_btn = types.KeyboardButton('Aiuto')
min_price = types.KeyboardButton('Prezzominimo')
max_price = types.KeyboardButton('Prezzomassimo')
range_price = types.KeyboardButton('Range')
keyboard.row(min_price)
keyboard.row(max_price)
keyboard.row(range_price)
keyboard.row(help_btn)
bot = telebot.AsyncTeleBot(TOKEN,'HTML')
if bot_is_active:
@bot.message_handler(commands=["start"])
def main_menu(message):
bot.send_message(message.chat.id,"Benvenuto,questo bot ti permette di cercare articoli su Amazon",reply_markup=keyboard)
pass
@bot.message_handler(func=lambda message:True)
def kb1_handler(message):
if message.text == 'Aiuto':
bot.send_message(message.chat.id,Help message)
elif message.text == 'Range':
bot.send_message(message.chat.id,"Cosa cerchi?")
#range_set = True
elif message.text == 'Prezzominimo':
bot.send_message(message.chat.id,"Cosa cerchi?")
min_set = True
else:
bot.send_message(message.chat.id,"Cosa cerchi?")
#max_set = True
pass
if min_set:
bot.send_message(message.chat.id,"trovato")
pass发布于 2020-08-17 09:09:24
我建议去看看图书馆的python-电报-bot和他们的信息非常丰富的维基。代码示例包括一个用于对话机器人的示例,听起来类似于您所描述的
https://stackoverflow.com/questions/63356984
复制相似问题