TShock icon indicating copy to clipboard operation
TShock copied to clipboard

Make more commands support silent command specifier

Open nojomyth-dev opened this issue 3 years ago • 8 comments

I don't know if it is possible, but i'd like to have a setting / permission with which you could disable the "{0} set the time to {1}" and other command chat messages, so it won't be broadcasted to everyone.

Describe the solution you'd like Permission/config setting to disable command announcements (maybe also one, so only SA can see them)

nojomyth-dev avatar Mar 06 '21 22:03 nojomyth-dev

We have silent commands already, but it's kinda up to each command that needs to support them. Which commands do you want silent (other than all of them)?

hakusaro avatar Apr 12 '21 05:04 hakusaro

Summon and i (items). If it is possible by implementation sudo. Thank you!

nojomyth-dev avatar Apr 12 '21 07:04 nojomyth-dev

Not sure where silence could be added to the item command, but I've added silent support to spawnboss in c72e64f

QuiCM avatar Apr 13 '21 05:04 QuiCM

What did you mean by implementation sudo? You want the ability to run a /sudo command silently? You should just be able to pass the silent command specifier to the sudo command itself (.sudo). Did you want /time as well?

hakusaro avatar Apr 13 '21 06:04 hakusaro

The silent modifier only hides the running user of the command, not the broadcasted message itself. I was asking if it was possible for commands to not send any message to anyone, like running it secretly. If i sent a command via the api silently it would show 'Time was set to

nojomyth-dev avatar Apr 13 '21 10:04 nojomyth-dev

Yeah, so, the intent was that over the long term, we would make every command support silent specifiers. The issue is that it's cumbersome to edit all of the commands. So, if you have a priority list of which things you want to run silently first, that's something we can work on. It's just without someone requesting it, it's hard to justify. I added silent command specifiers as a thing that people would want because I thought people would appreciate it, but I don't know how common people want to use it.

hakusaro avatar Apr 13 '21 17:04 hakusaro

Here’s what I propose:

  • Add a new bool flag in config called something like “silentAnonCmd” (false by default).
  • Rename the existing specifier from “silent” to “anonymous” to make it more accurately describe what it does.
  • Implement support for every relevant command that affects everyone else on the server and for existing ones that already publicly broadcast info msg (for example /slap?).
  • If this new config bool is set to true, whenever an user executes commands using the silent specifier, the command output msg will only be visible to the user. Otherwise it will be visible to all players, just without the name of whoever used the cmd.

This seems within what I can do atm so I can work on adding it.

So let me know which commands you’d like to see prioritized.

moisterrific avatar May 13 '21 04:05 moisterrific

I'm playing around with this in #2303 (most commits are from April 19th, but I kinda paused while exploring a better way to send command feedback). I don't agree with changing the specifier to "anonymous" (as the person who intended this to be silent, that's the point of it). I'm treating anything non-silence as a defect and changing it appropriately.

hakusaro avatar May 13 '21 09:05 hakusaro