在这里有一个嵌套结构,它开始于
@bot.message_handler(content_types=["text"])
def handle_text (message, user_markup=None):
紧接着是嵌套结构,这个函数就在里面
def wallet(message):
if message.text == 'Wallet NST':
sent=bot.send_message(message.chat.id, """Crypto currency is an Ethereum token.
NST Smart Contract Token Address is as follows:
(0xD89040Ac9823B72F64d71f66Fa2DeAE7C8520671).
Please make sure you are using the right smart contract or your funds may be irretrievably lost. \n
INFORM YOUR WALLET NST(NEW SOLUTION ) :""")
bot.register_next_step_handler(sent, salva)
def guard(message):
archive=open('oriondb.txt', 'w')
archive.write(int(messagefrom_user.id) + message.from_user.username + message.chat.text )
bot.send_message(message.chat.id, 'CARTEIRA SALVA COM SUCESSO!')
bot.register_next_step_handler( handle_text)
我想将答案保存到 txt 文件或数据库中,如何使用 pytelegramBotAPI 执行此操作?