Answer the question
In order to leave comments, you need to log in
How to display the ID of the person to whom you replied to the VK bot?
For example, I want that when I reply to a person in a conversation and write !go to me, the bot would write something like: "ID: (ID of the person I replied to)" How to do this?
Answer the question
In order to leave comments, you need to log in
from vkbottle import Bot
from vkbottle.bot import Message
bot = Bot(token='group_token')
bot.labeler.vbml_ignore_case = True
@bot.on.message(text=['айди', '!айди'])
async def user_id(message: Message):
uid = message.reply_message.from_id
await message.answer(f'Айди: {str(uid)}')
bot.run_forever()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question