Skip to content

Commit 7c5c228

Browse files
Fix Modlogs bug
1 parent 8e36335 commit 7c5c228

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Commands/Moderation/modlogs.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
toCheck =
1818
message.mentions.users.first() ||
1919
(await client.users.fetch(args[0], { cache: true }));
20+
2021
} catch (e) {
2122
if (e.httpStatus === 404)
2223
return message.reply({
@@ -28,14 +29,17 @@ module.exports = {
2829
});
2930
}
3031

31-
let docs = client.modlogs.get(toCheck.id)[message.guild.id];
32+
let docs = client.modlogs.get(toCheck.id);
33+
34+
if (docs) docs = docs[message.guild.id];
3235

3336
if (!docs || !docs.length)
3437
return message.reply({
35-
content: `No modlogs found for \`${toCheck.tag}\``,
38+
content: `No modlogs found for \`${toCheck.username}\``,
3639
allowedMentions: { repliedUser: false },
3740
});
3841

42+
3943
docs = docs.reverse();
4044

4145
const modlogsEmbed = new MessageEmbed()

0 commit comments

Comments
 (0)