-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./client" | ||
export * from "./response" | ||
export * from "./response" | ||
export * from "./interaction" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { APIApplicationCommandInteraction, APIBaseInteraction, InteractionResponseType, InteractionType } from "discord-api-types/v10"; | ||
import { DiscordResponse } from "./response"; | ||
|
||
export class SlashCommandInteraction | ||
{ | ||
interaction: APIApplicationCommandInteraction; | ||
|
||
constructor(interaction: APIBaseInteraction<InteractionType, any>) | ||
{ | ||
if(interaction.type != InteractionType.ApplicationCommand) | ||
{ | ||
throw new Error("Invalid interaction type. Expected ApplicationCommand") | ||
} | ||
|
||
this.interaction = interaction as APIApplicationCommandInteraction; | ||
} | ||
|
||
reply(data: any) | ||
{ | ||
return new DiscordResponse(InteractionResponseType.ChannelMessageWithSource, data); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
import { Command } from "types"; | ||
import {SlashCommandBuilder} from "@discordjs/builders"; | ||
import {EmbedBuilder, SlashCommandBuilder} from "@discordjs/builders"; | ||
import { DiscordResponse } from "client"; | ||
import { InteractionResponseType } from "discord-api-types/v10"; | ||
|
||
|
||
const command = { | ||
data: new SlashCommandBuilder() | ||
.setName("help") | ||
.setDescription("help me!") | ||
.setDescription("help me!"), | ||
execute(interaction) { | ||
|
||
const embed = new EmbedBuilder() | ||
.setTitle("L skillissue") | ||
.setDescription("git good lmao"); | ||
|
||
return interaction.reply({embeds: [embed]}); | ||
}, | ||
} satisfies Command; | ||
|
||
export default command; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import {SlashCommandBuilder} from "@discordjs/builders"; | ||
import { DiscordResponse, SlashCommandInteraction } from "client"; | ||
|
||
declare type Command = { | ||
data: SlashCommandBuilder | ||
data: SlashCommandBuilder, | ||
execute(interaction: SlashCommandInteraction): DiscordResponse | ||
}; |