woops again

This commit is contained in:
JandereDev 2022-03-02 16:30:58 +01:00
parent 284343f156
commit 50bd8e1c06
Signed by: Lea
GPG key ID: 5D5E18ACB990F57A

View file

@ -42,8 +42,14 @@ let commands: Command[];
msg.author_id == client.user?._id || msg.author_id == client.user?._id ||
!msg.channel?.server) return; !msg.channel?.server) return;
if (!msg.member) await msg.channel.server.fetchMember(msg.author_id); try {
if (msg.author?.bot) return; if (!msg.member) await msg.channel.server.fetchMember(msg.author_id);
if (!msg.author) await client.users.fetch(msg.author_id);
} catch(e) {
return msg.reply('⚠ Failed to fetch message author');
}
if (msg.author!.bot) return;
// If we can't reply to the message, return // If we can't reply to the message, return
if (!hasPermForChannel(await getOwnMemberInServer(msg.channel.server), msg.channel, 'SendMessage')) { if (!hasPermForChannel(await getOwnMemberInServer(msg.channel.server), msg.channel, 'SendMessage')) {