Answer the question
In order to leave comments, you need to log in
Discord API. How to display the game the user is playing?
There is a discord.py library. I went through the documentation and found Member.game - discordpy.readthedocs.io/en/latest/api.html#discord.Member.game
But I still don't understand how to use this method. Is there any way to output the game the user is playing?
Answer the question
In order to leave comments, you need to log in
Learn to express yourself more clearly.
To get the current status text (also known as "game name") from a server visitor , the Member.game field can be used .
If you want to change the status of the bot itself , then you need to use the Client.change_status(...) method .
await client.change_status(game=Game(name="Я не умею в гугл"))
yes, make a request to this API method, get the game and output.
sudo rm -rf / painted correctly, only the discord API has changed a little and now the game activity of users is stored in a different place.
guild.presences.cache.activities - here is an object with the name of the game, activity type, etc...
let selectUser = msg.guild.members.cache.find(member => member.user.id == IDПользователя);
selectUser.guild.presences.cache.map(prs=>console.log(prs.activities))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question