eduardo-olivares1 / Narwhal

A discord bot designed to alert users of important cryptocurrency movements and events.
MIT License
2 stars 1 forks source link

Add configurable narwhal prefix #10

Closed fredtsun closed 3 years ago

fredtsun commented 3 years ago

The permissions for this is based in the .env file. It looks for the key: PREFIX_CHANGE_ROLES. I.e.

PREFIX_CHANGE_ROLES=Admin1

The values for this can be presented as a comma separated string if multiple roles are needed. i.e.

PREFIX_CHANGE_ROLES=Admin1,Admin2,Admin3

Tested this locally:

  1. Give myself only the 'Admin' role.
  2. In .env, set PREFIX_CHANGE_ROLES=Admin
  3. sending $narwhalPrefix ~ results in bot responding: You may now speak to me using ~
  4. sending $narwhalPrefix ~ results in no message.
  5. sending ~narwhalPrefix $ results in bot responding: You may now speak to me using $
  6. restarting the server with .env as PREFIX_CHANGE_ROLES=FakeRole
  7. sending $narwhalPrefix ~ results in bot responding: You do not have permissions to change this.
fredtsun commented 3 years ago

Addresses #5

fredtsun commented 3 years ago

Also, it would make sense to merge #9 before this!