Input resolution - Bilal2453/discordia-components GitHub Wiki
Input Resolution (Resolvables)
discordia-components make use of the similar Discordia input-resolution idea. Whenever you see a type ending with -Resolvable look forward for it here. Some of resolvables here only accept one value, yet they exists; this is because it is easier to explain what it represents in one place, and link it to rest of places.
Custom-ID-Resolvable
Represents a custom_id field for a Discord message component, this is set developer side, and is useful to decide which component exactly did the user interact with.
- Lua string
Button-Resolvable
- Lua table that represents the raw button data (See Button Structure)
- Button object through
discordia_components.Button - Lua table that has following fields:
| Parameter | Type | Optional |
|---|---|---|
| type | number (see componentType enum) | Must be set to button. |
| id | Custom-ID-Resolvable | Only optional if style is set to link. |
| url | string | Only required if style is set to link. |
| label | string | ✔ |
| style | number (see componentType enum) | ✔ |
| emoji | Emoji-Resolvable | ✔ |
| disabled | boolean | ✔ |
| actionRow | number | ✔ |
SelectMenu-Resolvable
- Lua table that represents the raw Select Menu data (See Select Menu Structure)
- SelectMenu object through
discordia_components.SelectMenu - Lua table that has following fields:
| Parameter | Type | Optional |
|---|---|---|
| type | number (see componentType enum) | Must be set to selectMenu. |
| id | Custom-ID-Resolvable | |
| options | table | ✔ |
| minValues | number | ✔ |
| maxValues | number | ✔ |
| actionRow | number | ✔ |
Components-Resolvable
- Components instance through
discordia_components.Componentsclass - Button-Resolvable
- SelectMenu-Resolvable
- Lua array where each entry is a table representing a Button or SelectMenu (see above last entry)
Emoji-Resolvable
Not to be confused with Discordia's one. This here represents a partial emoji object.
- Emoji instance through
Emojiclass - Lua table that has the fields
name,idandanimated; where last two are optional.