mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
feat: slash commands and interactions (#248)
* start slash commands * lil bit of this * a little bit of that * chore: add slash commands' types (#249) * Add slash Types * style: format source files * interaction create event * make it a valid controller * respond to a slash command * interactions * shtuff * gotta get them all * you gotta hit the bullseye * you gotta survive * most important thing i forgot * please keep this * more shuttttfgvuasdafwesdvjzdk * more endpoints * TYPO * making that party jam * this is my jam * refactor: move slash commands types to webhook.ts (#250) * Move Types * Move to webhook.ts types file * Update webhook.ts * fix: update ExecuteSlashCommandOptions (#252) * Move Types * idk * Remove Unnecessary Comment * details * http side of slash * Format * idk * cleanup * fmt * fix imports * tet * remove log * Update interactions.ts * Update interactions.ts * Update interactions.ts * Use tweetnacl_deno for verification * chore: move tweetnacl import to deps.ts * Update deps.ts * deps: use tweetnacl from GitHub * fix: use serverOptions.slashHexKey * fix: res -> req * fix: use TextEncoder * deps: add std@0.81.0/encoding/hex.ts * chore: use encode() from std/encoding/hex.ts * I am using the GitHub online editor pls help * Update deps.ts * Update interactions.ts * Update interactions.ts * Update interactions.ts * Update interactions.ts * fix: respond with 400 if timestamp and signature not present * style: format files * refactor!: merge createServer() into startServer() * style: format files Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com> Co-authored-by: ayntee <ayyantee@gmail.com>
This commit is contained in:
@@ -101,6 +101,28 @@ export const endpoints = {
|
||||
WEBHOOK_DELETE: (id: string, token: string, messageID: string) =>
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${id}/${token}/messages/${messageID}`,
|
||||
|
||||
// Application Endpoints
|
||||
COMMANDS: (botID: string) =>
|
||||
`${baseEndpoints.BASE_URL}/applications/${botID}/commands`,
|
||||
COMMANDS_GUILD: (botID: string, id: string) =>
|
||||
`${baseEndpoints.BASE_URL}/applications/${botID}/guilds/${id}/commands`,
|
||||
COMMANDS_ID: (botID: string, id: string) =>
|
||||
`${baseEndpoints.BASE_URL}/applications/${botID}/commands/${id}`,
|
||||
COMMANDS_GUILD_ID: (botID: string, id: string, guildID: string) =>
|
||||
`${baseEndpoints.BASE_URL}/applications/${botID}/guilds/${guildID}/commands/${id}`,
|
||||
|
||||
// Interaction Endpoints
|
||||
INTERACTION_ID_TOKEN: (id: string, token: string) =>
|
||||
`${baseEndpoints.BASE_URL}/interactions/${id}/${token}/callback`,
|
||||
INTERACTION_ORIGINAL_ID_TOKEN: (id: string, token: string) =>
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${id}/${token}/messages/@original`,
|
||||
INTERACTION_ID_TOKEN_MESSAGEID: (
|
||||
id: string,
|
||||
token: string,
|
||||
messageID: string,
|
||||
) =>
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${id}/${token}/messages/${messageID}`,
|
||||
|
||||
// User endpoints
|
||||
USER: (id: string) => `${baseEndpoints.BASE_URL}/users/${id}`,
|
||||
USER_BOT: `${baseEndpoints.BASE_URL}/users/@me`,
|
||||
|
||||
Reference in New Issue
Block a user