diff --git a/examples/components/mod.ts b/examples/components/mod.ts index 5158730..a2f6ced 100644 --- a/examples/components/mod.ts +++ b/examples/components/mod.ts @@ -6,7 +6,7 @@ import { GatewayIntents, InteractionResponseTypes, Session, -} from "https://deno.land/x/biscuit/mod.ts?code"; +} from "https://deno.land/x/biscuit/mod.ts"; const token = Deno.env.get("TOKEN") ?? Deno.args[0]; @@ -32,7 +32,6 @@ session.on("messageCreate", (message) => { const args = message.content.substring(PREFIX.length).trim().split(/\s+/gm); const name = args.shift()?.toLowerCase(); - console.log(args, name); if (name === "ping") { message.reply({ components: [row] }); diff --git a/examples/slash-commands/mod.ts b/examples/slash-commands/mod.ts index a7d6e0a..16a9f31 100644 --- a/examples/slash-commands/mod.ts +++ b/examples/slash-commands/mod.ts @@ -20,14 +20,12 @@ const command: CreateApplicationCommand = { description: "Replies with pong!", }; -const guildId = ""; - session.on("ready", async (payload) => { console.log("Logged in as:", payload.user.username); console.log("Creating the application commands..."); // create command try { - await session.createApplicationCommand(command, guildId); + await session.createApplicationCommand(command); console.log("Done!"); } catch (err) { console.error(err); @@ -36,7 +34,10 @@ session.on("ready", async (payload) => { // Follow interaction event session.on("interactionCreate", (interaction) => { - if (!interaction.isCommand()) return; + if (!interaction.isCommand()) { + return; + } + if (interaction.commandName === "ping") { interaction.respond({ type: InteractionResponseTypes.ChannelMessageWithSource,