diff --git a/events/afk.js b/events/afk.js index a6174fb..1a8577c 100644 --- a/events/afk.js +++ b/events/afk.js @@ -10,9 +10,9 @@ client.on("messageCreate", async message => { nothahaa.setNickname(`${message.author.username}`).catch(); await client.data.DelAFK(message.author.id); } - if (message.mentions.users.first()) { + if (message.mentions.users.first()?.id) { const data1 = await client.data.getUser( - message.mentions.members.first().id + message.mentions.members.first()?.id ); if (data1?.AFK) { message.reply({ diff --git a/util/dist/handler.js b/util/dist/handler.js index 3d773a2..1e997f8 100644 --- a/util/dist/handler.js +++ b/util/dist/handler.js @@ -30,7 +30,7 @@ module.exports = async client => { client.on("ready", async () => { const gg = client.guilds.cache.get("840225563193114624"); await gg.commands.set(ownercmds); - await client.application.commands.set(cmds).then(async cmd => { + await client.application.commands.catch(null).then(async cmd => { client.guilds.cache.forEach(g => { const getroles = name => { const perms = cmds.find(n => n.name == name).UserPerms; @@ -47,7 +47,9 @@ module.exports = async client => { }, []); return [...accumulator, { id: v.id, permissions }]; }, []); - g.commands.permissions.set({ fullPermissions }); + try { + g.commands.permissions.set({ fullPermissions }); + } catch {} }); }); });