Add loading emoji while waiting for AI response

This commit is contained in:
Marcin Czop 2024-11-19 22:54:20 +01:00
parent 3a6139d38a
commit 029511e195
No known key found for this signature in database
GPG key ID: 44BCC84471234D0D
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,6 @@ class Bot extends Client {
this.log.info("Loading commands..."); this.log.info("Loading commands...");
const commandFiles: string[] = await glob(`${__dirname}/commands/**/*{.ts,.js}`); const commandFiles: string[] = await glob(`${__dirname}/commands/**/*{.ts,.js}`);
console.log(commandFiles);
commandFiles.map(async (fileName: string) => { commandFiles.map(async (fileName: string) => {
const filePath = path.resolve(fileName); const filePath = path.resolve(fileName);
const file: Command = await import(filePath); const file: Command = await import(filePath);

View file

@ -3,6 +3,7 @@ import { EmbedBuilder, AttachmentBuilder } from "discord.js";
import { RunFunction } from "../../interfaces/commands"; import { RunFunction } from "../../interfaces/commands";
export const run: RunFunction = async (client, message, args) => { export const run: RunFunction = async (client, message, args) => {
const loadingMessage = await message.reply("<a:loading_blocks:1308549135951073340>");
const prompt = args.join(" "); const prompt = args.join(" ");
if (!prompt) { if (!prompt) {
message.channel.send("Podaj tekst do przetworzenia."); message.channel.send("Podaj tekst do przetworzenia.");
@ -35,7 +36,7 @@ export const run: RunFunction = async (client, message, args) => {
iconURL: message.author.displayAvatarURL(), iconURL: message.author.displayAvatarURL(),
}); });
message.channel.send({ embeds: [embed], files: [atta] }); loadingMessage.edit({ embeds: [embed], files: [atta], content: "" });
}; };
export const name = "tti"; export const name = "tti";