MiraWaNeko / DiscordIntegration

Communicate between Minecraft and Discord
https://discordintegration.net
GNU Affero General Public License v3.0
88 stars 42 forks source link

Any way to strip commands made by server from relaying? #140

Closed tmzasz closed 6 years ago

tmzasz commented 6 years ago

Base informations

Minecraft version: 1.7.10 DiscordIntegration version: 3.0.5 ( shows 3.0.4 in console when a msg is redirected for some strange reason ) Server type and version: Forge/Spigot/Sponge Forge Link to pastebin with (censored) config: Optional

Expected behavior

Actual behavior

Steps to reproduce

have server issue any command and the bot puts the command in the channel

while setting up i noticed that the discord bot will relay server commands as well as player commands when relay commands is enabled im wondering if theres an easy way to filter out the servers commands from the relay as things like this [Server] executed discord config reload [Server] executed discord config reload [Server] executed discord config reload [Server] executed discord config reload [Server] executed discord config reload

and this ( from my auto restart script ) [Server] executed say going down for restart in 5 mins!!! [Server] going down for restart in 4 mins 45 seconds!!! [Server] executed say going down for restart in 4 mins 45 seconds!!! [Server] going down for restart in 4 mins 30 seconds!!! [Server] executed say going down for restart in 4 mins 30 seconds!!! [Server] going down for restart in 4 mins 15 seconds!!! [Server] executed say going down for restart in 4 mins 15 seconds!!!

are flooding the discord channel. i believe i can do it using the regex thing but not entirely sure how

Ricket commented 6 years ago

Within your dimension generic config, you can add: "relaySayCommand": false Same for relayMeCommand

Personally I just opted not to relay any commands, I set relayCommands to false.

For regex, I'm not sure exactly how it looks in the config but probably one of these:

"messageIgnoreRegex": ["going down for restart in"]

or maybe

"messageIgnoreRegex": [/going down for restart in/]

also inside the dimension generic config. That should filter out the going down for restart messages. If you wanted to filter only some of them then I could help you craft that regex as well.

tmzasz commented 6 years ago

hmm i tried the quote method but forgot about the open/close slashes i will try that and i have commands enabled but not /say commands which cut the spam in half :)