baines / insobot

C99 modular IRC bot with markov chains
MIT License
74 stars 5 forks source link

mod_alias + mod_psa interop #5

Closed baines closed 7 years ago

baines commented 7 years ago

Since they are quite similar, I think it would be nice if mod_psa was able to interoperate with mod_alias.

This would allow PSAs to use the % format options from mod_alias, and to create new PSAs that simply echo an already created alias — either periodically, or based on word matches.

It would also allow changing of an alias, and any associated PSAs would be kept in sync. Perhaps all PSAs could be linked to an alias, creating a new PSA named X would implicitly define a psa_X alias?

To make this happen, mod_alias would probably need to gain some MOD_MSGs to add and recall aliases; mod_psa could then be modified to use these.

There may be some complications. E.g. if a PSA was using an alias that is unaliased, what should happen? And how should it work with the local/global alias distinction?

baines commented 7 years ago

Since 6fc73c56 mod_psa can interoperate with mod_alias, you just need to set the psa message to start with !, followed by an alias name.

e.g.: !psa+ test 5m !keyboard would cause the keyboard alias to be sent every 5 mins. More info on alias / psa syntax: https://insobot.handmade.network/forums/t/2393-user_guide:_aliases_and_psas