rebolbot icon indicating copy to clipboard operation
rebolbot copied to clipboard

Rework how current message components are made visible to commands

Open asampal opened this issue 11 years ago • 3 comments

After modularization, some methods invoked by command parse rules still take as parameters some variables which are global (e.g. message-id, parent-id) and are set to the component of the current message being processed.

This is redundant and the current message handling should be reworked depending on how the bot is going to evolve (i.e. will it be always single tasking, handling just one chat room at once, handling just one chat system at once, etc.).

asampal avatar Apr 12 '13 08:04 asampal

I was going to rework it to pass the message as an object parameter

Sent from my iPod

On 12/04/2013, at 8:43 PM, asampal [email protected] wrote:

After modularization, some methods invoked by command parse rules still take as parameters some variables which are global (e.g. message-id, parent-id) and are set to the component of the current message being processed.

This is redundant and the current message handling should be reworked depending on how the bot is going to evolve (i.e. will it be always single tasking, handling just one chat room at once, handling just one chat system at once, etc.).

— Reply to this email directly or view it on GitHub.

gchiu avatar Apr 12 '13 21:04 gchiu

You can try that, but where would you want to define this object? In process-dialect? The individual command rules are concatenated there, but they are bound to variables in the particular command modules when the command module is created. I'm not clear myself (I'd have to experiment a little) how a newly created message object would be passed to functions of the command module by a function call in a rule.

asampal avatar Apr 12 '13 21:04 asampal

I'd create the object here https://github.com/gchiu/rebolbot/blob/master/rebolbot.r3#L303

gchiu avatar Apr 13 '13 21:04 gchiu