2020-01-14 05:15:34 +00:00
|
|
|
import { GuildMember, Guild } from 'discord.js';
|
|
|
|
import { developers } from '../config/bot';
|
|
|
|
|
|
|
|
export function calcUserLevel(user: GuildMember, guild: Guild) {
|
|
|
|
if (developers.includes(user.id)) {
|
|
|
|
return 5;
|
|
|
|
}
|
|
|
|
if (user.id === guild.ownerID) {
|
2020-01-19 18:55:35 +00:00
|
|
|
return 3;
|
2020-01-14 05:15:34 +00:00
|
|
|
}
|
|
|
|
if (user.permissions.has('ADMINISTRATOR', true)) {
|
2020-01-19 18:55:35 +00:00
|
|
|
return 2;
|
2020-01-14 05:15:34 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|