@@ -78,7 +78,7 @@ class Activity(DictSerializationMixin):
78
78
details : Optional [str ] = attrs .field (repr = False , default = None )
79
79
"""What the player is currently doing"""
80
80
state : Optional [str ] = attrs .field (repr = False , default = None )
81
- """The user's current party status"""
81
+ """The user's current party status, or text used for a custom status if type is set as CUSTOM """
82
82
emoji : Optional [PartialEmoji ] = attrs .field (repr = False , default = None , converter = optional (PartialEmoji .from_dict ))
83
83
"""The emoji used for a custom status"""
84
84
party : Optional [ActivityParty ] = attrs .field (repr = False , default = None , converter = optional (ActivityParty .from_dict ))
@@ -99,20 +99,23 @@ class Activity(DictSerializationMixin):
99
99
"""The custom buttons shown in the Rich Presence (max 2)"""
100
100
101
101
@classmethod
102
- def create (cls , name : str , type : ActivityType = ActivityType .GAME , url : Optional [str ] = None ) -> "Activity" :
102
+ def create (
103
+ cls , name : str , type : ActivityType = ActivityType .GAME , url : Optional [str ] = None , state : Optional [str ] = None
104
+ ) -> "Activity" :
103
105
"""
104
106
Creates an activity object for the bot.
105
107
106
108
Args:
107
109
name: The new activity's name
108
110
type: Type of activity to create
109
111
url: Stream link for the activity
112
+ state: Current party status, or text used for a custom status if type is set as CUSTOM
110
113
111
114
Returns:
112
115
The new activity object
113
116
114
117
"""
115
- return cls (name = name , type = type , url = url )
118
+ return cls (name = name , type = type , url = url , state = state )
116
119
117
120
def to_dict (self ) -> dict :
118
- return dict_filter_none ({"name" : self .name , "type" : self .type , "url" : self .url })
121
+ return dict_filter_none ({"name" : self .name , "type" : self .type , "state" : self . state , " url" : self .url })
0 commit comments