!! / !bang?
1:05 MetaBytez: Do you have a command !! that just repeats the last bot command
Kappa
1:05 MetaBytez: Or maybe !bang
Would you two be open to me taking a stab at this one?
iirc this is hard / not really feasible since every message is dispatched independently and asynchronously
I was poking around and the add_alias() function caught my muse. Would appear if an alias !bang and !! were made of the most recent command successfully found that you'd have part of the desired outcome. I may have missed some I/O but it looked to me like commands are only held in memory so this call felt very inexpensive.
https://github.com/anthonywritescode/twitch-chat-bot/blob/50341c30d8eada4b50634c8f25a9eb0eed681735/bot/data.py#L113-L116
How to handle keeping message permissions from being skipped, that all commands are stripped of extra bangs, and the command pattern doesn't presently match !! were where I stopped.
https://github.com/anthonywritescode/twitch-chat-bot/blob/50341c30d8eada4b50634c8f25a9eb0eed681735/bot/data.py#L144
https://github.com/anthonywritescode/twitch-chat-bot/blob/50341c30d8eada4b50634c8f25a9eb0eed681735/bot/data.py#L18
(either way, neat implementation and I learned a few things digging through it which was my primary goal!)
the aliasing system is for command names and probably wouldn't work or help for command values -- it's also meant to be ~immutable after process startup