Discord.py: How do I change the "Playing" status?

Created on 2 Dec 2018  路  13Comments  路  Source: Rapptz/discord.py

I've tried this code out, and it doesn't change the status from "Playing" to "Watching".
await bot.change_presence(activity=discord.activity(type=discord.ActivityType.watching, name='some commands'))
It gives me an AttributeError saying that module 'discord' has no attribute 'activity', so how do I change the "playing" status?

question

Most helpful comment

Are you on the async branch?
Because Activity (and discord.ActivityType) are only on the rewrite branch.
For the async branch, you'll have to manually set discord.Game.type.
For those values, see:
https://github.com/Rapptz/discord.py/blob/66e5033785259400d340b8c00eaa8ad60fbbb82a/discord/enums.py#L227-L232

Also, I noticed that you've already seen and reacted to a comment, in an issue this is a duplicate of, where I explained this already. In the future, please refrain from making duplicate issues, especially with questions that have already been answered.
For further help, you should really join either the official discord.py server or the Discord API server.

All 13 comments

This is not an issue with Discord.py.
GitHub issues for this repository should be used to report issues with this library.
They are not a medium for requesting help with Python.
For further help specific to using this library, you should join either the official discord.py server or the Discord API server, as the README recommends.

As for your issue, you need to watch your casing. The docs will show you the correct way.

await bot.change_presence(game=discord.Game(name='some game'))

@sghosh1810 That doesn't really answer the question, as the type for Game will always be ActivityType.playing. The Activity class is preferred here.

@sghosh1810 I already know how to change the status from 'Playing some game' into 'Playing another game', I just need to know how to change the 'Playing' part.

As has been explained, you need to use Activity.

@Harmon758 Can you provide an example of how to use it?

@ItWasAllIntended Then what is this an issue of if it's not about discord.py?

Github issues like this are for issues with the library not issues with not understanding how to use the library; this is the difference. Questions like this really should be directed to the discord server as mentioned before.

The line of code you provided should be fine, except that you're using a nonexistent discord.activity instead of discord.Activity. As has been explained, your issue is simply the casing.

@Harmon758 Now I'm getting an error that says module 'discord' has no attribute 'Activity'

@ItWasAllIntended, the solution you provided me only taught me to change what game my bot is playing, not the Playing part. And yes, I read the documentation and only provided me that.

Are you on the async branch?
Because Activity (and discord.ActivityType) are only on the rewrite branch.
For the async branch, you'll have to manually set discord.Game.type.
For those values, see:
https://github.com/Rapptz/discord.py/blob/66e5033785259400d340b8c00eaa8ad60fbbb82a/discord/enums.py#L227-L232

Also, I noticed that you've already seen and reacted to a comment, in an issue this is a duplicate of, where I explained this already. In the future, please refrain from making duplicate issues, especially with questions that have already been answered.
For further help, you should really join either the official discord.py server or the Discord API server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

synbitz picture synbitz  路  3Comments

MrBrahm picture MrBrahm  路  3Comments

Be4Vision picture Be4Vision  路  3Comments

j0hnmeow picture j0hnmeow  路  3Comments

Rimmy50 picture Rimmy50  路  3Comments