Skip to content

Commit

Permalink
feat: create SlashCommand class
Browse files Browse the repository at this point in the history
  • Loading branch information
feenko committed Dec 3, 2024
1 parent 4500e99 commit 3985cde
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Embed extends EmbedBuilder {
* Sets default embed properties including author information if provided
* @param author The Discord user to set as the embed author
*/
setDefaults(author?: User) {
setDefaults(author?: User): Embed {
if (!author) return this;

const name = author.displayName === author.username ? author.username
Expand Down
22 changes: 22 additions & 0 deletions src/structures/slashCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
ApplicationIntegrationType,
InteractionContextType,
SlashCommandBuilder,
} from "discord.js";

export class SlashCommand extends SlashCommandBuilder {
public constructor() {
super();

this.setDescription("...");

this.setContexts(
InteractionContextType.Guild,
InteractionContextType.BotDM,
InteractionContextType.PrivateChannel,
).setIntegrationTypes(
ApplicationIntegrationType.GuildInstall,
ApplicationIntegrationType.UserInstall,
);
}
}

0 comments on commit 3985cde

Please sign in to comment.