Presence¶
Inherits: DiscordEntity < Reference < Object
Description¶
A user's presence is their current state on Discord.
It gets updated on DiscordClient.presence_updated event.
Properties¶
| type | name |
|---|---|
| int | status |
| Array | activities |
| BitFlag | platforms |
Methods¶
| return type | signature |
|---|---|
| bool | on_desktop ( ) |
| bool | on_mobile ( ) |
| bool | on_web ( ) |
| String | static status_to_string ( int status ) |
| DiscordActivity | static playing ( String game ) |
| DiscordActivity | static listening ( String to ) |
| DiscordActivity | static streaming ( String what, String url ) |
| DiscordActivity | static create_activity ( String name, int type, String stream_url="" ) |
Constants¶
-
Dictionary Status
-
IDLE = 0
-
DND = 1
-
ONLINE = 2
-
INVISIBLE = 3
-
OFFLINE = 4
User status enum.
-
-
Dictionary Platforms
-
DESKTOP = 1
-
MOBILE = 2
-
WEB = 4
User's platform-dependent status enum.
-
Property Descriptions¶
-
int status
User's current status.
-
Array activities
User's current activities.
-
BitFlag platforms
The platform the user is connected on.
Method Descriptions¶
-
Presence Presence ( Dictionary data )
There is currently no description for this method.
-
bool on_desktop ( )
Check whether the user is connected on the desktop client.
-
bool on_mobile ( )
Check whether the user is connected on the mobile client.
-
bool on_web ( )
Check whether the user is connected on the web client.
-
String static status_to_string ( int status )
Converts a
Statusenum value to their respective string name.
-
DiscordActivity static playing ( String game )
Constructs a game activty.
-
DiscordActivity static listening ( String to )
Constructs a listening activty.
-
DiscordActivity static streaming ( String what, String url )
Constructs a streaming activty in which
whatis the title andurlis a Twitch or YouTube url.
-
DiscordActivity static create_activity ( String name, int type, String stream_url="" )
Constructs an activity where
typetakes anDiscordActivity.Typeandnameis the activity name.stream_urlis specific toDiscordActivity.Type.STREAMINGactivity type.