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

refactor(discordx): discordjs builders support #1065

Merged
merged 3 commits into from
Jun 29, 2024
Merged

refactor(discordx): discordjs builders support #1065

merged 3 commits into from
Jun 29, 2024

Conversation

vijayymmeena
Copy link
Member

Example

import {
  SlashCommandBuilder,
  SlashCommandMentionableOption,
  User,
  type CommandInteraction,
} from "discord.js";
import { Discord, Slash, SlashOption } from "discordx";

const cmd = new SlashCommandBuilder()
  .setName("hello")
  .setDescription("Say hello!");

const user_option = new SlashCommandMentionableOption()
  .setName("user")
  .setDescription("Mention user to say hello to.")
  .setRequired(true);

@Discord()
export class Example {
  @Slash(cmd)
  async hello(
    @SlashOption(user_option) user: User,
    interaction: CommandInteraction,
  ): Promise<void> {
    await interaction.reply(`:wave: ${user}`);
  }
}

@vijayymmeena vijayymmeena merged commit c7c1759 into main Jun 29, 2024
2 checks passed
@vijayymmeena vijayymmeena deleted the builder branch June 29, 2024 21:28
vijayymmeena added a commit that referenced this pull request Jul 2, 2024
* refactor(discordx): discordjs builders support

* refactor: add doc example

* refactor: bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant