Activity
Implementation of Discord Activity as a Luau builder.
https://discord.com/developers/docs/events/gateway-events#activity-object
Note: Only YouTube and Twitch URLs are allowed for streaming.
Summary
Properties
Activity.name :: stringActivity.activityType :: api_types.ActivityTypeActivity.streamingURL :: string?Properties
Section titled “Properties”The name of the activity that is displayed.
activityType
Section titled “activityType” Activity.activityType :: ActivityType
The type of activity being performed.
streamingURL
Section titled “streamingURL”The URL of the stream, only YouTube and Twitch URLs are supported.
Methods
Section titled “Methods”setActivityName
Section titled “setActivityName”Activity : setActivityName ( name ) -> Activity
Sets the name of the activity.
Parameters
| name: string |
Returns
| Activity |
setActivityType
Section titled “setActivityType”Activity : setActivityType ( activityType ) -> Activity
Sets the type of the activity.
Parameters
| activityType: ActivityType |
Returns
| Activity |
setStreamingURL
Section titled “setStreamingURL”Activity : setStreamingURL ( streamURL ) -> Activity
Sets the streaming URL of the activity. Only YouTube and Twitch URLs are allowed.
Parameters
| streamURL: string |
Returns
| Activity |
Activity : build ( ) -> JSON
Builds the activity JSON payload that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”Activity . new ( resource ) -> Activity
Creates a new Activity.
local activity = Activity.new({ name = "Playing a game", activityType = "Game", streamingURL = "https://twitch.tv/example"})Parameters
| resource: { name: string?, activityType: apiTypes.ActivityType?, streamingURL: string?, } |
Returns
| Activity |