W
W
wirflve2021-10-01 12:37:47
Python
wirflve, 2021-10-01 12:37:47

Problem with vkbottle?

Hello. I have such a problem, if I write text = 'test' in the decorator, and
if I write Test, not test, then it will not respond. How to fix this without using text = ['Test', 'test']?
here is a sample code:

import asyncio
from vkbottle.bot import Bot, Message

bot = Bot("токен")

@bot.on.private_message(text="test")
async def hi_handler(message: Message):
    users_info = await bot.api.users.get(message.from_id)
    await message.answer("Привет, {}".format(users_info[0].first_name))

bot.run_forever()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2021-10-01
@wirflve

bot.labeler.vbml_ignore_case = Trueafter bot initialization

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question