Skip to content

Commit

Permalink
Fix match notifications role giving
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalissaac committed Jul 30, 2020
1 parent d7f75d3 commit 108e592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 5 additions & 1 deletion src/services/matchNotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
}
})
}
}

0 comments on commit 108e592

Please sign in to comment.