Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash Commands and Interactions #2295

Merged
merged 37 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
30e6cca
Slash Commands and Interactions documentation
msciotti Dec 9, 2020
ab6892a
Nits and TODOs
msciotti Dec 9, 2020
d0479f9
Merge branch 'master' into feature/interactions
msciotti Dec 9, 2020
3792e8b
create, not created
msciotti Dec 10, 2020
452fa08
Fix python make command example
msciotti Dec 10, 2020
0e12e9e
More endpoints
msciotti Dec 10, 2020
f84f72b
groups and subcommands
msciotti Dec 10, 2020
a4e5d78
should be application id
msciotti Dec 10, 2020
261dfc9
interaction create event
msciotti Dec 11, 2020
3928824
Rate limits and maximums
msciotti Dec 11, 2020
36108ce
http verbs
msciotti Dec 11, 2020
0b79af3
Signature validation examples
msciotti Dec 11, 2020
bc58e57
More limits
msciotti Dec 11, 2020
957c592
a better intro
msciotti Dec 14, 2020
50e71ef
swap code samples for sig validation
msciotti Dec 14, 2020
f619909
global -> guild, list -> array
msciotti Dec 14, 2020
101135a
Fix missing id params
msciotti Dec 14, 2020
2c6c4cb
wrong role type
msciotti Dec 14, 2020
54b3ace
NOW the right role type
msciotti Dec 14, 2020
83965c7
PR Fixes and Application Object
msciotti Dec 14, 2020
f9398a7
application on ready
msciotti Dec 14, 2020
a946e0b
headings
msciotti Dec 14, 2020
05bef7d
10s all the way down
msciotti Dec 14, 2020
4eb79ae
grammar and spelling
msciotti Dec 14, 2020
7eaef0d
broken links
msciotti Dec 15, 2020
aaed196
more broken links
msciotti Dec 15, 2020
b3279d9
what even?
msciotti Dec 15, 2020
85e6679
options -> object
msciotti Dec 15, 2020
0810253
one more broken link
msciotti Dec 15, 2020
194aa7e
make things less dangerous
msciotti Dec 15, 2020
c58c4ab
not webhook
msciotti Dec 15, 2020
b50621f
Broken links and spelling
msciotti Dec 15, 2020
4a82475
fix old merge issue in webhook edit
msciotti Dec 15, 2020
11b21c6
subcommand warning
msciotti Dec 15, 2020
5b969d3
PR feedback
msciotti Dec 15, 2020
c39f703
add s
msciotti Dec 15, 2020
9adc416
spelling
msciotti Dec 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/Change_Log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## Slash Commands and Interactions
#### December 15, 2020

Slash Commands are here! There's a _lot_ to cover, so go check out specific documentation under [Slash Commands](#DOCS_INTERACTIONS_SLASH_COMMANDS/).

Slash Commands include some new features for webhooks as well:

- Webhooks can now update previously-sent message from the same webhook using [Edit Webhook Message](#DOCS_RESOURCES_WEBHOOK/edit-webhook-message)
msciotti marked this conversation as resolved.
Show resolved Hide resolved

## Inline Replies

#### November 16, 2020
Expand Down
837 changes: 837 additions & 0 deletions docs/interactions/Slash_Commands.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/resources/Channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Represents a message sent in a channel within Discord.
###### Message Types

> warn
> Replies only have type `19` in API v8. In v6, they are still type `0`.
> Type `19` and `20` are only in API v8. In v6, they are still type `0`.

| Type | Value |
|----------------------------------------|-------|
Expand All @@ -238,6 +238,7 @@ Represents a message sent in a channel within Discord.
| GUILD_DISCOVERY_DISQUALIFIED | 14 |
| GUILD_DISCOVERY_REQUALIFIED | 15 |
| REPLY | 19 |
| APPLICATION_COMMAND | 20 |

###### Message Activity Structure

Expand Down
4 changes: 3 additions & 1 deletion docs/resources/Webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ Add a new webhook to your GitHub repo (in the repo's settings), and use this end

## Edit Webhook Message % PATCH /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}

Edits a previously-sent webhook message from the same token. Takes the same JSON parameters as [Execute Webhook](#DOCS_RESOURCES_WEBHOOK/execute-webhook).
msciotti marked this conversation as resolved.
Show resolved Hide resolved

> info
> All parameters to this endpoint are optional and nullable.

Expand All @@ -165,4 +167,4 @@ Add a new webhook to your GitHub repo (in the repo's settings), and use this end

# Delete Webhook Message % DELETE /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}

Deletes a message that was created by the webhook. Returns a 204 NO CONTENT response on success.
Deletes a message that was created by the webhook. Returns a 204 NO CONTENT response on success.
7 changes: 7 additions & 0 deletions docs/topics/Community_Resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ Many of these libraries are represented in the [unofficial, community-driven Dis
| [Sword](https://github.com/Azoy/Sword) | Swift |
| [Discordeno](https://github.com/Skillz4Killz/Discordeno) | TypeScript |

## Interactions

[Interactions and Slash Commands](#DOCS_INTERACTIONS_SLASH_COMMANDS/) are the great, new way of making a Discord bot. The following open-source libraries provide help for the security and authentication checks that are mandatory if you are receiving Interactions via outgoing webhook. They also include some types for the Interactions data models.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comma after great feels weird.


- [discord-interactions-js](https://github.com/discord/discord-interactions-js)
- [discord-interactions-python](https://github.com/discord/discord-interactions-python)

## Game SDK Tools

Discord Game SDK's lobby and networking layer shares similarities with other gaming platforms (i.e. Valve's Steamworks SDK). The following open source library provides developers a uniform interface for these shared features and can simplify developing for multiple platforms. Note: this library is tailored for Unity3D development.
Expand Down
7 changes: 7 additions & 0 deletions docs/topics/Gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ Events are payloads sent over the socket to a client that correspond to events i
| [Voice State Update](#DOCS_TOPICS_GATEWAY/voice-state-update) | someone joined, left, or moved a voice channel |
| [Voice Server Update](#DOCS_TOPICS_GATEWAY/voice-server-update) | guild's voice server was updated |
| [Webhooks Update](#DOCS_TOPICS_GATEWAY/webhooks-update) | guild channel webhook was created, update, or deleted |
| [Interaction Create](#DOCS_TOPICS_GATEWAY/interaction-create) | user used a [Slash Command](#DOCS_INTERACTIONS_SLASH_COMMANDS/) |

### Event Names

Expand Down Expand Up @@ -1215,6 +1216,12 @@ Sent when a guild channel's webhook is created, updated, or deleted.
| guild_id | snowflake | id of the guild |
| channel_id | snowflake | id of the channel |

### Interactions

### Interaction Create

Sent when a user in a guild uses a [Slash Command](#DOCS_INTERACTIONS_SLASH_COMMANDS/). Inner payload is an [Interaction](#DOCS_INTERACTIONS_SLASH_COMMANDS/interaction).

## Get Gateway % GET /gateway

> info
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/command-with-groups-subcommands.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.