Open sudojunior opened 2 years ago
// current if (condition) { // run code } // proposed try { check(condition, failReason); } catch (error) { await ctx.send(error?.message || error); return; }
Approach to testing condition is derived from test framework assertions assert(condition, reason).
assert(condition, reason)
Currently used for the setup wizard when checking for channel permissions. https://github.com/TinkerStorm/interaction-prototypes/blob/232ff467bb4ad6c4a11c45c3db7bfeca2437182f/src/commands/setup.ts#L115-L132
Approach to testing condition is derived from test framework assertions
assert(condition, reason)
.Currently used for the setup wizard when checking for channel permissions. https://github.com/TinkerStorm/interaction-prototypes/blob/232ff467bb4ad6c4a11c45c3db7bfeca2437182f/src/commands/setup.ts#L115-L132