Skip to content

Commit

Permalink
Fix autorole on member joins
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVR authored Jul 24, 2021
1 parent 856ae29 commit d2aad1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const guildMemberAdd = (client: Client, db: Db, tempDB: DB) => async (
const roleName = role.startsWith('bot-') ? role.substr(4) : role
const roleObj = member.guild.roles.find(element => element.name === roleName)
if (!role || !roleObj) return
if (role.startsWith('bot-') && member.user.bot) member.addRole(roleObj.id)
else if (!role.startsWith('bot-') && !member.user.bot) member.addRole(roleObj.id)
if (role.startsWith('bot-') && member.user.bot) await member.addRole(roleObj.id)
else if (!role.startsWith('bot-') && !member.user.bot) await member.addRole(roleObj.id)
} catch (e) {}
})
}
Expand Down

0 comments on commit d2aad1b

Please sign in to comment.