nixnest / scepter

Spiritual successor to Nixbot
https://discord.gg/g3gD5xd
MIT License
6 stars 5 forks source link

Implemeted individual permission system to replace permission levels #51

Closed known-as-dan closed 4 years ago

known-as-dan commented 4 years ago

I implemented a permission system that allows you to specify which permissions your command requires of the user, in-order to execute.

Old "Command" structure:

type Command = {
  name: string,
  description: string,
  ...
  permissionLevel?: number,
  ...
}

New structure:

type Command = {
  name: string,
  description: string,
  ...
  permissions?: PermissionResolvable[],
  ...
}

Usage example: permissions: ['MANAGE_NICKNAMES', 'MANAGE_ROLES' ... ]

ldelelis commented 4 years ago

Looks fine after local tests. Can I ask you to apply this patch and re-aim the change to the develop branch please?

index 0e0b0e6..50a6ab8 100644
--- modules/mutes.ts
+++ modules/mutes.ts
@@ -27,8 +27,6 @@ const checkMutes = async (client: Client) => {
   let guildMemberId: string
   let muteRole: Role

-  console.log(client['timerData'].entries())
-
   for (let entry of client['timerData'].entries()) {
     if (entry[1] === INDEFINITE_MUTE) continue
     if (curDate > entry[1]) {

Thanks for the contribution!

known-as-dan commented 4 years ago

Added coin flip module.

usage: s.flip

example: @User#0000, Tails!