This commit is contained in:
juanmaldini7 committed 2026-09-28 11:55:22 -03:00
1 parent ca253f1b16
commit 1db75ad984
1 file changed
+10 -1
+10 -1
View File
@@ -66,7 +66,12 @@ client.once(Events.ClientReady, async (c) => {
});
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand() || !interaction.inCachedGuild()) return;
if (!interaction.isChatInputCommand()) return;
console.log(`/${interaction.commandName} de ${interaction.user.tag} en guild ${interaction.guildId}`);
if (!interaction.inCachedGuild()) {
console.warn('guild no cacheada: ¿el bot está invitado con el scope "bot"?');
return interaction.reply({ content: 'El bot no está bien agregado a este servidor.', flags: MessageFlags.Ephemeral });
}
const { guildId } = interaction;
if (interaction.commandName === 'start') {
@@ -120,4 +125,8 @@ client.on(Events.VoiceStateUpdate, (oldState) => {
}
});
process.on('unhandledRejection', (err) => console.error('unhandledRejection:', err));
client.on(Events.Error, (err) => console.error('client error:', err));
console.log('iniciando bot…');
client.login(process.env.DISCORD_TOKEN);