fix: examples

This commit is contained in:
Yuzu 2022-07-14 20:59:52 -05:00
parent fbe426dbdb
commit 6e6aac1443
2 changed files with 6 additions and 6 deletions

View File

@ -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] });

View File

@ -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,