Make testing for moderator state centralized in User class

This commit is contained in:
Gabe Kangas
2023-03-03 21:54:01 -08:00
parent e5dee5d258
commit c4f057eded
6 changed files with 59 additions and 27 deletions

View File

@@ -140,15 +140,3 @@ export function emojify(HTML, emojiList) {
}
return HTML;
}
// MODERATOR UTILS
export function checkIsModerator(message) {
const { user } = message;
const { scopes } = user;
if (!scopes || scopes.length === 0) {
return false;
}
return scopes.includes('MODERATOR');
}