feat: enhance image generation handling and normalize response structure in AI service

This commit is contained in:
2025-10-04 03:25:09 -05:00
parent a6c47cca5e
commit bff0bbb993
2 changed files with 41 additions and 37 deletions

View File

@@ -46,8 +46,7 @@ export const command: CommandMessage = {
return;
}
//@ts-ignore
await message.channel.sendTyping().catch(() => {});
(message.channel as any)?.sendTyping?.().catch(() => {});
const result = await aiService.generateImage(prompt, { size });
await message.reply({
@@ -55,7 +54,7 @@ export const command: CommandMessage = {
files: [{ attachment: result.data, name: result.fileName }]
});
} catch (error: any) {
logger.error('Error generando imagen:', error);
logger.error(error, 'Error generando imagen');
await message.reply({ content: `❌ Error generando imagen: ${error?.message || 'Error desconocido'}` });
}
}