CactusDev / CactusBot

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

Ability to have a custom command output as a whisper #184

Open mwilkinson81 opened 7 years ago

mwilkinson81 commented 7 years ago

It would be nice to have the ability to specify if a custom command should be output in the general chat or as a whisper to the user that ran the command.

For example there could be a modifier like /w that you put at the beginning of the command output it should implicitly run the output as "/whisper %name%"

Example:

EngineerWilky81: !command add quietCmd /w You're now being quiet with CactusBot CactusBotAlpha: Added command !quietCmd EngineerWilky81: !quietCmd EngineerWilky81 > CactusBotAlpha You're now being quiet with CactusBot

2Cubed commented 7 years ago

Definitely a good idea. We need a good service-agnostic syntax for this, though.

Maybe an extra limiter? . could be good, if so. (Think hidden .direcrories.)

!command add .quiet Sssssh!
kondrik commented 7 years ago

I want to be able to add a command that can whisper to a specific user, not just the user who activates the command, so if there could just be some kind of "/w @target" type thing that the bot detects & turns into a whisper/PM, that would be nice.

Alkali-Metal commented 7 years ago

Quick question; what would the usage of something like that be? I can't think of a usage for it :/

kondrik commented 7 years ago

It would allow automating things that require other bots/services.

/w @StreamJar !leaderboard to make StreamJar respond with leaderboard stats on a schedule, etc.

I would personally be using it to make the bot whisper at my ScorpBot instance to trigger my command that loops through a list of people & shouts them out. Currently, it's posting the command to chat, and I'd prefer to have it whisper, so I don't have an unnecessary chat message.

Alkali-Metal commented 7 years ago

Ahh, that makes sense. Okay, yeah, I was just unsure of a use for it but I can see the usage for it.

2Cubed commented 7 years ago

@kondrik Interesting... do you have any ideas for syntax? :thinking:

Alkali-Metal commented 7 years ago

Maybe something like

[Alk] !command add >fish Alkali_Metal YOU'RE A FISH!
[CB] Command added.
[2^3] !fish
[CB --> Alk] YOU'RE A FISH!

Where it takes the first argument after the command name as the target.

kondrik commented 7 years ago

I would still want the command to be able to be mod-only or caster-only, so it would need to be possible to combine permissions and whisper.

You could always do like I've seen other bots do, and detect if the message starts with /w, then use the second word of the message as the target.

Using Alkali's example:

[2³] !command add +fish /w @Alkali_Metal YOU'RE A FISH!
[CactustBot] Command added.
[Alkali_Metal] !fish
[CactusBot] Moderator Only Command
[2³] !fish
[CactusBot --> Alkali_Metal] YOU'RE A FISH!
Alkali-Metal commented 7 years ago

Yeah that could work.

And if the multi-limiter thing isn't already a part of the bot (don't know because I can't test right now) it should be, because the limiters should be allowed to work together. CC: 2Cubed

2Cubed commented 7 years ago

Multi-limiters don't currently work, intentionally... but simply because we only have + and $, which make no sense to combine.

Once we add . and >, which will be in a "group" like the user-level limiters, you'll be able to combine one from each group!

!command add +>fish @Alkali_Metal YOU'RE A FISH!
!command add $.ip Here's the secret IP to the Patreon server: 127.0.0.1