Advice: Paste error message and code in the question, no links.
Quote:
Unhandledpromiserejectionwarning: rangeerror: invalid permission string or number.
Supposing the error is here,
if (!permissions.has('SPEEK')) {
Are you sure 'SPEEK' is correct ?
Advice: Learn to use the debugger, it will help you to see where is the error and the variables associated, the context.