Closed Asartea closed 3 months ago
We can certainly extract out the logic for isAdmin
to a util function. Can just pass in the member so we have like const isAdminMessage = isAdmin(message.member)
and const isAdminUser = isAdmin(authorMember)
or equivalent.
Complete the following REQUIRED checkboxes:
- [ ] The title of this issue follows thecommand name: brief description of request
format, e.g./help: add optional @user parameter
The following checkbox is OPTIONAL:
1. Description of the Feature Request: We currently duplicate the code for checking if an user is an "admin" in a number of places using roughly this snippet[1]
this duplicates code, and also can be simplified to
It would be beneficial to abstract this functionality out to a new
is-admin.js
file in/utils
[1] Taken from
points.js
2. Acceptance Criteria: