Extending CommandContext
You may have encountered a situation when you want to receive custom data within Seyfert CommmandContext.
This is possible within Seyfert all you need to do is setting the context
option when defining Seyfert’s client, which expects the data you want to add to the context to be returned in the first parameter callback of a function predefined by Seyfert called extendContext
.
1import { Client, extendContext } from 'seyfert';2
3const context = extendContext((interaction) => {4 //here you can handle your custom context with the interaction/message of your command5
6 return {7 myCoolProp: 'seyfert>>'8 }9})10
11const client = new Client({ context });