AlexzanderFlores / WOKCommands

130 stars 61 forks source link

How to pass in global const to a command? #118

Open VadneyK opened 3 years ago

VadneyK commented 3 years ago

Hello I am using the polkadot.js api with the discord API so I want to be able to pass in the polkadot api instance that I instatiated into the commands, but it seems that the WOKCommands only allows for direct user input. How can I pass in global const in to the commands ?

Currently I am instantiating the api in the command which is not ideal. Instead I want to do it right next to where I declare const client = to make the discord api over here.

With default discord.js I can just pass in the commands manually into the execute command as seen here: https://github.com/PlasmNetwork/dusty-faucet/blob/0f59a5ae3e601e558d2300c9e4a2f94e545e6619/app/src/app.ts#L98