CactusDev / CactusBot

An open source, community-written service-agnostic chat bot
MIT License
30 stars 6 forks source link

Add filter that can be used with %COUNT% to by user execution #189

Closed mwilkinson81 closed 7 years ago

mwilkinson81 commented 7 years ago

It'd be nice to have a filter like |user to use with the %count% variable to only count the number of times the user that ran the command had ran the command.

For Example:

EngineerWilky81: !command add userCount %name% ran this command %count|user% times. CactusBotAlpha: command !userCount added. EngineerWilky81: !userCount CactusBotAlpha: EngineerWilky81 ran this command 1 times. ImoutoKurpo: !userCount CactusBotAlpha: ImoutoKurpo ran this command 1 times.

2Cubed commented 7 years ago

Hmm... this would be "difficult", as we'd have to store a lot more than a simple integer.

Also, what happens in the following cases? (Who do the runs "belong to"?)

!command count potato +5
!command count potato -5
!command count potato =100
Alkali-Metal commented 7 years ago

Maybe you could reduce the amount of storage needed by instead implementing it per stream. (The filter makes it reset to 0 at the end of the stream) and then the !command count can just modify all instances of %count% including the per stream ones in the command, because I don't really see any purpose for per-user counts. See #177

2Cubed commented 7 years ago

Hmm... that's a good point, actually. What would be the purpose of per-user counters? cc: @mwilkinson81

Alkali-Metal commented 7 years ago

Like, I can see it being a neat little addition just to play around with a bit but I don't see any real purpose of it. :/

Alkali-Metal commented 7 years ago

I feel as though this could be obliterated due to the fact none of us can think of any purpose for this and @mwilkinson81 hasn't responded at all.

(But per stream %COUNT%s should exist, I would imagine something like the filter %COUNT|stream% or something like that.)

2Cubed commented 7 years ago

Closing. (Can reopen if we discover a purpose for it later.)