diff --git a/package.json b/package.json index 0f98586..f553ebd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrimbot", - "version": "1.2.0", + "version": "1.2.1", "description": "A Discord bot for organizing Valorant custom games.", "main": "src/index.js", "scripts": { diff --git a/src/services/matchNotifications.js b/src/services/matchNotifications.js index eeafb43..ea96f04 100644 --- a/src/services/matchNotifications.js +++ b/src/services/matchNotifications.js @@ -5,7 +5,11 @@ module.exports = exports = { GLOBALS.client.on('guildMemberAdd', async member => { const guildData = await GLOBALS.db.collection('guilds').doc(member.guild.id).get() if (!guildData.exists) return - member.roles.add(guildData.get('notificationRole')) + + const memberData = await GLOBALS.db.collection('users').doc(member.id).get() + if (memberData.exists && memberData.get('notifications')) { + member.roles.add(guildData.get('notificationRole')) + } }) } }