Answer the question
In order to leave comments, you need to log in
How to use dataset for VK bot (vkbottle)?
Hello, I am writing a VK bot using vkbottle, I want to teach it to check the incoming message for a match from the file and respond in accordance with the text.
#I have a dataset file dialog.txt with the content:
hello\hello\0
hello\darova\0
hello\ku\0
hello\shalom\0
hello\salaam\0
hello\darova how are you\0
etc #At the
moment the bot responds like this:
@bot.on.message(text=["Hello", "Hello"])
async def message_handler(message: Message):
user = await bot.api.users.get(message.from_id)
await message. answer(f"Hello to you too, {user[0].first_name}")
Thanks in advance for your help, if anyone can help.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question