made it show less error

This commit is contained in:
night0721 2022-01-23 06:12:37 +08:00
parent 9a87d6c1ea
commit 90a5d7e3f5
2 changed files with 6 additions and 4 deletions

View file

@ -10,9 +10,9 @@ client.on("messageCreate", async message => {
nothahaa.setNickname(`${message.author.username}`).catch(); nothahaa.setNickname(`${message.author.username}`).catch();
await client.data.DelAFK(message.author.id); await client.data.DelAFK(message.author.id);
} }
if (message.mentions.users.first()) { if (message.mentions.users.first()?.id) {
const data1 = await client.data.getUser( const data1 = await client.data.getUser(
message.mentions.members.first().id message.mentions.members.first()?.id
); );
if (data1?.AFK) { if (data1?.AFK) {
message.reply({ message.reply({

View file

@ -30,7 +30,7 @@ module.exports = async client => {
client.on("ready", async () => { client.on("ready", async () => {
const gg = client.guilds.cache.get("840225563193114624"); const gg = client.guilds.cache.get("840225563193114624");
await gg.commands.set(ownercmds); 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 => { client.guilds.cache.forEach(g => {
const getroles = name => { const getroles = name => {
const perms = cmds.find(n => n.name == name).UserPerms; const perms = cmds.find(n => n.name == name).UserPerms;
@ -47,7 +47,9 @@ module.exports = async client => {
}, []); }, []);
return [...accumulator, { id: v.id, permissions }]; return [...accumulator, { id: v.id, permissions }];
}, []); }, []);
g.commands.permissions.set({ fullPermissions }); try {
g.commands.permissions.set({ fullPermissions });
} catch {}
}); });
}); });
}); });