S
S
samperirrrrr2020-12-16 19:56:38
In contact with
samperirrrrr, 2020-12-16 19:56:38

How to make a command in a bot?

Hello. Help make a team that will choose a random name and person ID.
module - vk_api

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2020-12-16
@samperirrrrr

In conversation or where?
https://vk.com/dev/messages.getConversationMembers
An example with a name. From there, you can pull out the ID

users = vk.method("messages.getConversationMembers", {("peer_id": event.obj.peer_id})["profiles"]
user = random.choice(users)["first_name"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question