Typescript based framework for building Bluesky bots. Designed to be easily extendable, this bot framework can be used to make almost any bot you could want.
20
stars
0
forks
source link
Update order of parameters in `handle` function #52
In AbstractMessageAction, the handle function accepts two parameters: message, and handlerAgent.
I want to switch the order to have handlerAgent first. This way I can make an AbstractAction that can accept only the handlerAgent, and does not rely on messages. This can be used for #47 to make functions for other handler types.
The same thing needs to be done with AbstractValidator. The handle and shouldTrigger functions have message as the first parameter, and handlerAgent as the second.
For validators, I want to make a new AbstractMessageValidator that is almost identical to the existing AbstractValidator but the order of the handle and shouldTrigger parameters are switched. Then in AbstractValidator, handle and shouldTrigger should only accept a handlerAgent, so it can be used for Handlers other than the jetstream message handler
The same also goes for AbstractMessageHandler and other Handlers.
There should be a new AbstractHandler that only accepts the lowest level abstract classes, validators are AbstractValidator and actions are AbstractAction. For the handle function, it should accept a handlerAgent, then any additional args
AbstractMessageHandler will extend that handler
In
AbstractMessageAction
, the handle function accepts two parameters: message, and handlerAgent.I want to switch the order to have handlerAgent first. This way I can make an
AbstractAction
that can accept only the handlerAgent, and does not rely on messages. This can be used for #47 to make functions for other handler types.The same thing needs to be done with
AbstractValidator
. Thehandle
andshouldTrigger
functions have message as the first parameter, and handlerAgent as the second. For validators, I want to make a newAbstractMessageValidator
that is almost identical to the existingAbstractValidator
but the order of the handle and shouldTrigger parameters are switched. Then inAbstractValidator
, handle and shouldTrigger should only accept a handlerAgent, so it can be used for Handlers other than the jetstream message handlerThe same also goes for
AbstractMessageHandler
and other Handlers. There should be a newAbstractHandler
that only accepts the lowest level abstract classes, validators areAbstractValidator
and actions areAbstractAction
. For the handle function, it should accept a handlerAgent, then any additional argsAbstractMessageHandler
will extend that handler