Skip to content

Commit

Permalink
Fix: TypeError: Cannot read properties of undefined (reading 'id')
Browse files Browse the repository at this point in the history
  • Loading branch information
levisantosp committed Jun 29, 2022
1 parent 53a927b commit fcc46be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discord/src/listeners/guilds/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = class MessageCreateListener extends Listener {
if(message.channel.type == Constants.ChannelTypes.DM) return;
const bank = await Bank.findById('bank') || new Bank({_id: 'bank'});
bank.save();
const guild = await Guild.findById(message.guildID) || new Guild({_id: message.guild.id});
const guild = await Guild.findById(message.guildID) || new Guild({_id: message.guildID});
const user = await User.findById(message.member.id);
switch(message.channel.parentID) {
case '988470650781962260': guild.lang = 'pt';
Expand Down

0 comments on commit fcc46be

Please sign in to comment.