mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 22:16:08 +00:00
fix: examples
This commit is contained in:
parent
fbe426dbdb
commit
6e6aac1443
@ -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] });
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user