Answer the question
In order to leave comments, you need to log in
How to make the VK bot respond to commands without "/"?
There is a bot with a generation code that responds to commands like /g, /gen, /gen.
It is necessary that the bot respond to the same commands, only without the "/" (g, gen, gene)
Example: A person writes "gen" to the bot, the bot responds to this word.
Generation code below:
from vk import types
from vk.bot_framework.dispatcher import Blueprint
from neuron import send_and_gen_sentence
from utils import get_api
bp = Blueprint()
api = get_api()
@bp.message_handler(commands=["g", "gen", "generate", "ген", "г", "говно", "генерируй", "генерация"])
async def generate(message: types.Message, _):
await send_and_gen_sentence(
f"dialogs/dialogs{message.peer_id}.txt", message.peer_id
)
Answer the question
In order to leave comments, you need to log in
In my opinion, using some kind of "frameworks" for a bot that reacts to commands is too much
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question