Activity class
Activity structure
Bots are only able to send name, type, and optionally url.
https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
- Annotations
-
- @JsonSerializable(includeIfNull: false)
Constructors
-
Activity({required String name, required ActivityType type, String? url, required DateTime createdAt, ActivityTimestamps? timestamps, String? applicationId, String? details, String? state, Emoji? emoji, ActivityParty? party, ActivityAssets? assets, ActivitySecrets? secrets, bool? instance, List<
ActivityFlag> ? flags, List<ActivityButton> ? buttons}) - Constructor
-
Activity.fromJson(Map<
String, dynamic> json) -
From json
factory
Properties
- applicationId → String?
-
application id for the game
final
- assets → ActivityAssets?
-
images for the presence and their hover texts
final
-
the custom buttons shown in the Rich Presence (max 2)
final
- createdAt → DateTime
-
unix timestamp (in milliseconds) of when the activity was added to the
user's session
final
- details → String?
-
what the player is currently doing
final
- emoji → Emoji?
-
the emoji used for a custom status
final
-
flags
→ List<
ActivityFlag> ? -
activity flags ORd together, describes what the payload includes
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- instance → bool?
-
whether or not the activity is an instanced game session
final
- name → String
-
the activity's name
final
- party → ActivityParty?
-
information for the current party of the player
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secrets → ActivitySecrets?
-
secrets for Rich Presence joining and spectating
final
- state → String?
-
the user's current party status
final
- timestamps → ActivityTimestamps?
-
unix timestamps for start and/or end of the game
final
- type → ActivityType
-
activity type
final
- url → String?
-
stream url, is validated when type is 1
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - To json
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited