thje
This commit is contained in:
parent
e16f5ecd5c
commit
5d13801f15
2 changed files with 11 additions and 17 deletions
|
@ -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" +
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue