Skip to content

Commit

Permalink
Create _role.js
Browse files Browse the repository at this point in the history
  • Loading branch information
syahrularranger authored Jul 20, 2021
1 parent 81f840e commit b6ac728
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions plugins/_role.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
let handler = m => m

handler.before = function (m) {
let user = global.db.data.users[m.sender]
let role = ((user.level >= 1) && (user.level <= 10)) ? 'Beginner'
: ((user.level >= 10) && (user.level <= 20)) ? 'Kittel Town'
: ((user.level >= 20) && (user.level <= 30)) ? 'Black Woods'
: ((user.level >= 30) && (user.level <= 40)) ? 'Farmount'
: ((user.level >= 40) && (user.level <= 50)) ? 'Rosenvale'
: ((user.level >= 50) && (user.level <= 60)) ? 'Amberhill'
: ((user.level >= 60) && (user.level <= 70)) ? 'Master Fap'
: ((user.level >= 70) && (user.level <= 80)) ? 'Master Woods'
: 'Legend'
user.role = role
return true
}

module.exports = handler

0 comments on commit b6ac728

Please sign in to comment.