import { Message } from "discord.js"; import { replyWithCleanup } from "../utilities"; export const handleReactCommand = async (message: Message) => { if (message.author.bot) return; if (!message.content.startsWith("uma!react")) return; if (!message.guild || message.author.id !== message.guild.ownerId) return; const parameters = message.content.split(" "); if (parameters.length < 3) { await replyWithCleanup( message, "❌ Usage: `uma!react `", ); return; } const messageId = parameters[1]; const emoji = parameters[2]; try { const targetMessage = await message.channel.messages.fetch(messageId); if (!targetMessage) { await replyWithCleanup(message, "❌ Message not found."); return; } await targetMessage.react(emoji); } catch (error) { console.error("Error reacting to message:", error); await replyWithCleanup(message, "❌ Failed to react to the message."); } };