Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
4x8Matrix committed May 31, 2024
2 parents 51d64be + 84fe923 commit a4eb4f5
Show file tree
Hide file tree
Showing 53 changed files with 1,480 additions and 3,248 deletions.
2 changes: 1 addition & 1 deletion discord-luau
Submodule discord-luau updated 102 files
75 changes: 24 additions & 51 deletions src/content/docs/classes/Builders/ActivityBuilder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,36 @@
title: ActivityBuilder
description: DiscordLuau docs for ActivityBuilder.
---
[//]: # (This file was automatically compiled through the Generator luau code under this repository)
[//]: # (if you want to edit the documentation of discord-luau, please write changes)
[//]: # (to the discord-luau repository itself, we extract the comments from discord-luau and translate)
[//]: # (them into markdown files that Nextra can interpret!)

[//]: # "This file was automatically compiled through the Generator luau code under this repository"
[//]: # "if you want to edit the documentation of discord-luau, please write changes"
[//]: # "to the discord-luau repository itself, we extract the comments from discord-luau and translate"
[//]: # "them into markdown files that Nextra can interpret!"
[//]: # "----- DOCUMENT IMPORTS ----- "
[//]: # (----- DOCUMENT IMPORTS ----- )

import LuaDeclaration from "$/components/LuaDeclaration.astro";
import LuaProperty from "$/components/LuaProperty.astro";
import LuaDeclaration from '$/components/LuaDeclaration.astro';
import LuaProperty from '$/components/LuaProperty.astro';

[//]: # "----- DOCUMENT DESCRIPTION ----- "
[//]: # (----- DOCUMENT DESCRIPTION ----- )

ActivityBuilder is used to construct an activity object for a Discord bot - including name, type, and streaming URL.

Usage:

```lua
local activity = ActivityBuilder.new()
:setActivityName("Playing a game")
:setActivityType(ActivityBuilder.Type.Game)
:setStreamingURL("https://twitch.tv/example")
```

[//]: # "----- DOCUMENT PROPERTIES ----- "
[//]: # (----- DOCUMENT PROPERTIES ----- )

## Properties

### Type

## <LuaProperty name="ActivityBuilder.Type" type="table" />

<LuaProperty name="ActivityBuilder.Type" type="table" />
---
An enumeration of activity types.

- Game: 0
Expand All @@ -41,59 +40,33 @@ An enumeration of activity types.
- Watching: 3
- Competing: 5

[//]: # "----- DOCUMENT METHODS ----- "
[//]: # (----- DOCUMENT METHODS ----- )

## Methods

### setActivityName

> <LuaDeclaration
> name="setActivityName"
> className="ActivityBuilder"
> args={[{ name: "activityName", type: "string" }]}
> returnType="Builders.ActivityBuilder"
> isMethod
> />
> Sets the name of the activity.
> <LuaDeclaration name="setActivityName" className="ActivityBuilder" args={[ { name: "activityName", type: "string" } ]} returnType="Builders.ActivityBuilder" isMethod />
Sets the name of the activity.
### setActivityType

> <LuaDeclaration
> name="setActivityType"
> className="ActivityBuilder"
> args={[{ name: "activityType", type: "number" }]}
> returnType="Builders.ActivityBuilder"
> isMethod
> />
> Sets the type of the activity.
> <LuaDeclaration name="setActivityType" className="ActivityBuilder" args={[ { name: "activityType", type: "number" } ]} returnType="Builders.ActivityBuilder" isMethod />
Sets the type of the activity.
### setStreamingURL

> <LuaDeclaration
> name="setStreamingURL"
> className="ActivityBuilder"
> args={[{ name: "streamURL", type: "string" }]}
> returnType="Builders.ActivityBuilder"
> isMethod
> />
> Sets the streaming URL of the activity. Only YouTube and Twitch URLs are allowed.
> <LuaDeclaration name="setStreamingURL" className="ActivityBuilder" args={[ { name: "streamURL", type: "string" } ]} returnType="Builders.ActivityBuilder" isMethod />
Sets the streaming URL of the activity. Only YouTube and Twitch URLs are allowed.
### toPayloadObject

> <LuaDeclaration
> name="toPayloadObject"
> className="ActivityBuilder"
> args={[]}
> returnType="Network.Resolvable"
> isMethod
> />
> Converts the activity to a JSON object that can be sent to the Discord API.
> <LuaDeclaration name="toPayloadObject" className="ActivityBuilder" args={[ ]} returnType="Network.Resolvable" isMethod />
Converts the activity to a JSON object that can be sent to the Discord API.

[//]: # "----- DOCUMENT FUNCTIONS ----- "
[//]: # (----- DOCUMENT FUNCTIONS ----- )

## Functions

### new

> <LuaDeclaration name="new" className="ActivityBuilder" args={[]} />
> Creates a new instance of ActivityBuilder.
> <LuaDeclaration name="new" className="ActivityBuilder" args={[ ]} />
Creates a new instance of ActivityBuilder.

59 changes: 59 additions & 0 deletions src/content/docs/classes/Builders/AttachmentBuilder.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: AttachmentBuilder
description: DiscordLuau docs for AttachmentBuilder.
---
[//]: # (This file was automatically compiled through the Generator luau code under this repository)
[//]: # (if you want to edit the documentation of discord-luau, please write changes)
[//]: # (to the discord-luau repository itself, we extract the comments from discord-luau and translate)
[//]: # (them into markdown files that Nextra can interpret!)

[//]: # (----- DOCUMENT IMPORTS ----- )

import LuaDeclaration from '$/components/LuaDeclaration.astro';
import LuaProperty from '$/components/LuaProperty.astro';

[//]: # (----- DOCUMENT DESCRIPTION ----- )

AttachmentBuilder allows you to build attachments that you can send files through to the discord API.

Usage:
```lua
local DiscordLuau = require("../Submodules/DiscordLuau")

local AttachmentBuilder = DiscordLuau.AttachmentBuilder.new()
:setName("Example.txt")
:setData("My Text Document!")
```

[//]: # (----- DOCUMENT PROPERTIES ----- )

## Properties

The AttachmentBuilder instance has no set properties!

[//]: # (----- DOCUMENT METHODS ----- )

## Methods

### setName

> <LuaDeclaration name="setName" className="AttachmentBuilder" args={[ { name: "name", type: "string" } ]} returnType="Builders.AttachmentBuilder" isMethod />
Set the name for this Attachment
### setDescription

> <LuaDeclaration name="setDescription" className="AttachmentBuilder" args={[ { name: "description", type: "string" } ]} returnType="Builders.AttachmentBuilder" isMethod />
Set the description for this Attachment
### setData

> <LuaDeclaration name="setData" className="AttachmentBuilder" args={[ { name: "data", type: "string" } ]} returnType="Builders.AttachmentBuilder" isMethod />
Set the data for this Attachment

[//]: # (----- DOCUMENT FUNCTIONS ----- )

## Functions

### new

> <LuaDeclaration name="new" className="AttachmentBuilder" args={[ { name: "intentList", type: "{ string }" } ]} />
Creates a new instance of AttachmentBuilder with the specified intents.

Loading

0 comments on commit a4eb4f5

Please sign in to comment.