A
A
ArtiRam2021-10-27 18:22:23
In contact with
ArtiRam, 2021-10-27 18:22:23

How to make the bot (Vkbottle) send a message when a new user is added to the conversation?

I'm learning python by clicking, writing a simple bot using the VKBottle library. I want to implement such a function in which the bot will greet people who join the chat, please tell me how best to implement this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WolfInChains, 2021-11-02
@ArtiRam

from vkbottle.bot import Bot, Message, rules

bot = Bot(token="")


@bot.on.chat_message((rules.ChatActionRule("chat_invite_user"), rules.ChatActionRule("chat_invite_user_by_link")))
async def user_joined(message: Message) -> None:
    await message.answer("Приветствуем в нашем чате")

bot.run_forever()

A
Alan Gibizov, 2021-10-27
@phaggi

how best to implement it.

It is best to stop learning python at random, study it systematically and return to vkontaktebots.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question