X
X
Xacker_Name2021-12-20 15:15:02
In contact with
Xacker_Name, 2021-12-20 15:15:02

How to send a message via vkwave by user id?

How to send a message via vkwave by user id?

There is a code:

import config as c
TOKEN = c.token
GROUP_ID = 209652072

from vkwave.bots import SimpleLongPollBot

bot = SimpleLongPollBot(tokens=TOKEN, group_id=GROUP_ID)

@bot.message_handler(bot.text_contains_filter("Начать"))
async def handle(event: bot.SimpleBotEvent) -> str:
  id_user = event.user_id
  user_data = (await event.api_ctx.users.get(user_ids=event.object.object.message.peer_id)).response[0]
  return f"Привет {user_data.first_name}"


print('Бот запущен!')
bot.run_forever()


With this code, it sends a message in response, but I want that if the person is new in the bot, then send him a message and me / admin Tell me
how pliz

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question