From 5d13801f15d1efe7de2940ac7ae0263b0c7b7dc0 Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Thu, 10 Oct 2024 11:56:53 +0200 Subject: [PATCH] thje --- src/commands/fun/gelbooru.js | 19 +++---------------- src/index.js | 9 ++++++++- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/commands/fun/gelbooru.js b/src/commands/fun/gelbooru.js index f00af46..e0b3305 100644 --- a/src/commands/fun/gelbooru.js +++ b/src/commands/fun/gelbooru.js @@ -110,7 +110,7 @@ module.exports = { const booru = interaction.options.getString("booru") ?? defaultBooru; const nsfw = interaction.options.getBoolean("nsfw") ?? false; - await interaction.reply("Searching, please wait..."); + await interaction.reply("<:search:1293874677915320330> Searching, please wait..."); const searchTags = [...(nsfw ? [] : ["-rating:explicit", "-rating:questionable"]), ...tags]; const startTime = process.hrtime.bigint(); @@ -119,7 +119,7 @@ module.exports = { while (post == null) { var newPost = (await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }))[0]; if (newPost == null) { - await interaction.editReply("Could not find any post matching tags."); + await interaction.editReply("<:warning:1293874152150667315> Could not find any post matching tags."); return; } if (/*!nsfw && isNSFWPost(newPost) || */isAIPost(newPost)) continue; @@ -154,26 +154,13 @@ module.exports = { .setTitle(`Post #${post.id}`) .setURL(post.postView) .setDescription(description) - /* .setFields([{ - name: "Score", - value: formatScore(post.score), - inline: true - }, { - name: "Rating", - value: formatRating(post.rating), - inline: true - }, { - name: "Tags", - value: formatTags(post.tags), - inline: false - }])*/ .setImage(post.fileUrl) .setFooter({ text: footerText, iconURL: `https://${post.booru.domain}/favicon.ico`, }) - await interaction.editReply({ embeds: [embed.data] }); + await interaction.editReply({ content: "", embeds: [embed.data] }); } else { await interaction.editReply( '>>> ' + bold(`[Post #${post.id}](<${post.postView}>)`) + "\n" + diff --git a/src/index.js b/src/index.js index 352e6af..df60d5b 100644 --- a/src/index.js +++ b/src/index.js @@ -40,6 +40,13 @@ client.on(Events.InteractionCreate, async interaction => { return; } + var options = ""; + for (const option of interaction.options.data) { + options += option.name + ":" + option.value + } + + console.log(`${interaction.user.username} ran /${interaction.commandName} ${options}`); + try { interaction.defaultModel = "llama-3.1-70b-versatile"; await command.execute(interaction); @@ -57,7 +64,7 @@ client.on(Events.InteractionCreate, async interaction => { } }); -client.once(Events.ClientReady, async() => { +client.once(Events.ClientReady, async () => { console.log(`Ready! Logged in as ${client.user.displayName}`); var user = client.user.toJSON();