commit 90a5d7e3f5b39b9b37a7f3e169688490fc22e79f
parent 9a87d6c1ea706bc96429e5a608184cff463ec622
Author: night0721 <[email protected]>
Date: Sun, 23 Jan 2022 06:12:37 +0800
made it show less error
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git 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
@@ -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 {}
});
});
});