Xujiayao / Discord-MC-Chat

Discord-MC-Chat (DMCC), formerly known as MC-Discord-Chat and MCDiscordChat (MCDC), is a practical and powerful Fabric and Quilt Minecraft <> Discord chat bridge inspired by BRForgers/DisFabric
https://blog.xujiayao.com/posts/4ba0a17a/
MIT License
63 stars 36 forks source link

[Bug] Filtered message with Chat Control mod is broadcasted to Discord #144

Closed RumoaNoa closed 1 month ago

RumoaNoa commented 1 year ago

Checks

Java Version

17.0.7

Minecraft Version

1.19.4

MCDiscordChat Version

2.1.4

Description

I'm using Chat Control mod (Github link) (version 1.2) to filter out bad words from game chat. The filtered message is gone from the game chat, but it is broadcasted to Discord. Switching formatChatMessages to any value doesn't work.

Screencast from 2023-06-07 15-39-35.webm

To Reproduce

  1. Add a word/phrase/regex to chatcontrol.json config file. Example:
    "words": [
     "...",
     "censor",
     "..."
    ],

    Reload the config with /filter config reload.

  2. Type the word in the game chat and send.

Log

Details
[15:29:09] [main/INFO]: Loading Minecraft 1.19.4 with Fabric Loader 0.14.21
[15:29:09] [main/INFO]: Loading 137 mods:
    - afkdisplay 1.1.0
       |-- com_moandjiezana_toml_toml4j 0.7.2
       \-- placeholder-api 2.1.0+1.19.4
    - antixray 1.3.0
    - banhammer 0.6.4+1.19.3
       |-- com_mysql_mysql-connector-j 8.0.31
       |-- fabric-permissions-api-v0 0.2-SNAPSHOT
       |-- org_postgresql_postgresql 42.5.1
       |-- org_xerial_sqlite-jdbc 3.40.*.*
       \-- sgui 1.2.0+1.19.3
    - carpet 1.4.101+v230319
    - chat-control 1.2
    - collective 6.54
    - discord_command 1.2.0
    - easyauth 3.0.0-15
       |-- at_favre_lib_bcrypt 0.9.0
       |-- at_favre_lib_bytes 1.5.0
       |-- de_mkammerer_argon2-jvm 2.11
       |-- de_mkammerer_argon2-jvm-nolibs 2.11
       |-- fabric-permissions-api-v0 0.2-SNAPSHOT
       |-- mysql_mysql-connector-java 8.0.29
       |-- net_java_dev_jna_jna 5.12.1
       |-- org_iq80_leveldb_leveldb 0.12
       |-- org_iq80_leveldb_leveldb-api 0.12
       |-- org_mongodb_bson 4.7.0
       |-- org_mongodb_mongodb-driver-core 4.7.0
       |-- org_mongodb_mongodb-driver-sync 4.7.0
       \-- server_translations_api 2.0.0-beta.2+1.19.4-pre2
            \-- packet_tweaker 0.3.1+23w06a
    - easywhitelist 1.0.1
    - fabric-api 0.83.0+1.19.4
       |-- fabric-api-base 0.4.27+1e9487d2f4
       |-- fabric-api-lookup-api-v1 1.6.28+504944c8f4
       |-- fabric-biome-api-v1 13.0.9+10ce000ff4
       |-- fabric-block-api-v1 1.0.8+e022e5d1f4
       |-- fabric-blockrenderlayer-v1 1.1.37+10ce000ff4
       |-- fabric-client-tags-api-v1 1.0.18+10ce000ff4
       |-- fabric-command-api-v1 1.2.30+f71b366ff4
       |-- fabric-command-api-v2 2.2.9+10ce000ff4
       |-- fabric-commands-v0 0.2.47+df3654b3f4
       |-- fabric-containers-v0 0.1.57+df3654b3f4
       |-- fabric-content-registries-v0 3.5.12+10ce000ff4
       |-- fabric-convention-tags-v1 1.5.2+10ce000ff4
       |-- fabric-crash-report-info-v1 0.2.17+aeb40ebef4
       |-- fabric-data-generation-api-v1 11.4.3+10ce000ff4
       |-- fabric-dimensions-v1 2.1.48+10ce000ff4
       |-- fabric-entity-events-v1 1.5.16+10ce000ff4
       |-- fabric-events-interaction-v0 0.6.0+10ce000ff4
       |-- fabric-events-lifecycle-v0 0.2.55+df3654b3f4
       |-- fabric-game-rule-api-v1 1.0.35+a1ccd7bff4
       |-- fabric-item-api-v1 2.1.20+10ce000ff4
       |-- fabric-item-group-api-v1 3.0.8+10ce000ff4
       |-- fabric-key-binding-api-v1 1.0.35+504944c8f4
       |-- fabric-keybindings-v0 0.2.33+df3654b3f4
       |-- fabric-lifecycle-events-v1 2.2.18+10ce000ff4
       |-- fabric-loot-api-v2 1.1.30+10ce000ff4
       |-- fabric-loot-tables-v1 1.1.34+9e7660c6f4
       |-- fabric-message-api-v1 5.1.4+10ce000ff4
       |-- fabric-mining-level-api-v1 2.1.42+10ce000ff4
       |-- fabric-models-v0 0.3.33+10ce000ff4
       |-- fabric-networking-api-v1 1.3.4+10ce000ff4
       |-- fabric-networking-v0 0.3.44+df3654b3f4
       |-- fabric-object-builder-api-v1 7.0.6+10ce000ff4
       |-- fabric-particles-v1 1.0.26+10ce000ff4
       |-- fabric-recipe-api-v1 1.0.11+10ce000ff4
       |-- fabric-registry-sync-v0 2.2.3+10ce000ff4
       |-- fabric-renderer-api-v1 2.3.1+10ce000ff4
       |-- fabric-renderer-indigo 1.3.1+10ce000ff4
       |-- fabric-renderer-registries-v1 3.2.41+df3654b3f4
       |-- fabric-rendering-data-attachment-v1 0.3.31+10ce000ff4
       |-- fabric-rendering-fluids-v1 3.0.24+10ce000ff4
       |-- fabric-rendering-v0 1.1.44+df3654b3f4
       |-- fabric-rendering-v1 2.1.4+10ce000ff4
       |-- fabric-resource-conditions-api-v1 2.3.3+10ce000ff4
       |-- fabric-resource-loader-v0 0.11.5+5ade3c38f4
       |-- fabric-screen-api-v1 1.0.48+10ce000ff4
       |-- fabric-screen-handler-api-v1 1.3.23+10ce000ff4
       |-- fabric-sound-api-v1 1.0.11+10ce000ff4
       |-- fabric-transfer-api-v1 3.2.1+10ce000ff4
       \-- fabric-transitive-access-wideners-v1 3.2.0+10ce000ff4
    - fabric-language-kotlin 1.9.4+kotlin.1.8.21
       |-- org_jetbrains_kotlin_kotlin-reflect 1.8.21
       |-- org_jetbrains_kotlin_kotlin-stdlib 1.8.21
       |-- org_jetbrains_kotlin_kotlin-stdlib-jdk7 1.8.21
       |-- org_jetbrains_kotlin_kotlin-stdlib-jdk8 1.8.21
       |-- org_jetbrains_kotlinx_atomicfu-jvm 0.20.2
       |-- org_jetbrains_kotlinx_kotlinx-coroutines-core-jvm 1.6.4
       |-- org_jetbrains_kotlinx_kotlinx-coroutines-jdk8 1.6.4
       |-- org_jetbrains_kotlinx_kotlinx-datetime-jvm 0.4.0
       |-- org_jetbrains_kotlinx_kotlinx-serialization-cbor-jvm 1.5.0
       |-- org_jetbrains_kotlinx_kotlinx-serialization-core-jvm 1.5.0
       \-- org_jetbrains_kotlinx_kotlinx-serialization-json-jvm 1.5.0
    - fabricloader 0.14.21
    - fabrictailor 2.1.1
       |-- config2brigadier 1.2.3
       \-- fabric-permissions-api-v0 0.2-SNAPSHOT
    - ferritecore 5.2.0
    - floodgate 2.2.0-SNAPSHOT
    - geyser-fabric 2.1.0-SNAPSHOT
       \-- fabric-permissions-api-v0 0.2-SNAPSHOT
    - headfix 1.2.1
    - java 17
    - krypton 0.2.2
       \-- com_velocitypowered_velocity-native 3.2.0-SNAPSHOT
    - ledger 1.2.7
       |-- fabric-permissions-api-v0 0.2-SNAPSHOT
       \-- server_translations_api 2.0.0-beta.2+1.19.4-pre2
            \-- packet_tweaker 0.3.1+23w06a
    - lithium 0.11.1
    - mcdiscordchat 2.1.4
       |-- com_fasterxml_jackson_core_jackson-annotations 2.15.1
       |-- com_fasterxml_jackson_core_jackson-core 2.15.1
       |-- com_fasterxml_jackson_core_jackson-databind 2.15.1
       |-- com_google_code_gson_gson 2.10.1
       |-- com_neovisionaries_nv-websocket-client 2.14
       |-- com_squareup_okhttp3_okhttp 4.11.0
       |-- com_squareup_okio_okio 2.10.0
       |-- com_vdurmont_emoji-java 5.1.1
       |-- mcdiscordchat-1_19_4 2.1.4
       |-- net_dv8tion_jda 5.0.0-beta.9
       |-- net_sf_trove4j_trove4j 3.0.3
       |-- org_apache_commons_commons-collections4 4.4
       |-- org_json_json 20230227
       \-- org_slf4j_slf4j-api 2.0.7
    - memoryleakfix 1.0.0
       \-- com_github_llamalad7_mixinextras 0.2.0-beta.6
    - minecraft 1.19.4
    - nochatreports 1.19.4-v2.1.4
       |-- fabric-rendering-v1 2.1.3+504944c8f4
       \-- fabric-screen-api-v1 1.0.47+3bd4ab0ff4
    - persistent-pearls 1.0.1
    - starlight 1.1.1+fabric.ae22326
    - tabtps-fabric 1.3.17
       |-- adventure-platform-fabric 5.8.0
       |    |-- net_kyori_adventure-api 4.13.0
       |    |-- net_kyori_adventure-key 4.13.0
       |    |-- net_kyori_adventure-platform-api 4.2.0
       |    |-- net_kyori_adventure-text-logger-slf4j 4.13.0
       |    |-- net_kyori_adventure-text-minimessage 4.13.0
       |    |-- net_kyori_adventure-text-serializer-gson 4.13.0
       |    |-- net_kyori_adventure-text-serializer-plain 4.13.0
       |    |-- net_kyori_examination-api 1.3.0
       |    \-- net_kyori_examination-string 1.3.0
       |-- cloud 1.8.3
       |    |-- cloud_commandframework_cloud-brigadier_ 1.8.3
       |    |-- cloud_commandframework_cloud-core_ 1.8.3
       |    |-- cloud_commandframework_cloud-services_ 1.8.3
       |    |-- fabric-permissions-api-v0 0.2-SNAPSHOT
       |    \-- io_leangen_geantyref_geantyref 1.3.13
       |-- cloud_commandframework_cloud-minecraft-extras 1.8.3
       |-- com_typesafe_config 1.4.2
       |-- net_kyori_adventure-serializer-configurate4 4.13.1
       |-- net_kyori_adventure-text-feature-pagination 4.0.0-SNAPSHOT
       |-- net_kyori_adventure-text-serializer-legacy 4.13.1
       |-- org_spongepowered_configurate-core 4.1.2
       \-- org_spongepowered_configurate-hocon 4.1.2
    - villagernames 5.2
    - worldborder 4.1
[15:29:09] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/container/libraries/net/fabricmc/sponge-mixin/0.12.5+mixin.0.8.5/sponge-mixin-0.12.5+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER
[15:29:09] [main/INFO]: Compatibility level set to JAVA_17
[15:29:10] [main/INFO]: Loaded configuration file for Lithium: 114 options available, 2 override(s) found
[15:29:10] [main/WARN]: Force-disabling mixin 'alloc.blockstate.StateMixin' as rule 'mixin.alloc.blockstate' (added by mods [ferritecore]) disables it and children
[15:29:10] [main/WARN]: Force-disabling mixin 'world.player_chunk_tick.ThreadedAnvilChunkStorageMixin' as rule 'mixin.world.player_chunk_tick' (added by mods [krypton]) disables it and children
[15:29:10] [main/INFO]: [MemoryLeakFix] Will be applying 1 memory leak fixes!
[15:29:10] [main/INFO]: [MemoryLeakFix] Currently enabled memory leak fixes: [biomeTemperatureLeak]
[15:29:12] [main/INFO]: Mixing common.MixinFriendlyByteBuf from mixins/common/nochatreports.mixins.json into net.minecraft.class_2540
[15:29:12] [main/INFO]: Renaming synthetic method lambda$onWriteJsonWithCodec$1(Ljava/lang/Object;Ljava/lang/String;)Lio/netty/handler/codec/EncoderException; to mdb2fbde$nochatreports$lambda$onWriteJsonWithCodec$1$0 in mixins/common/nochatreports.mixins.json:common.MixinFriendlyByteBuf from mod nochatreports
[15:29:12] [main/INFO]: Renaming synthetic method lambda$onReadJsonWithCodec$0(Ljava/lang/String;)Lio/netty/handler/codec/DecoderException; to mdb2fbde$nochatreports$lambda$onReadJsonWithCodec$0$1 in mixins/common/nochatreports.mixins.json:common.MixinFriendlyByteBuf from mod nochatreports
[15:29:16] [main/INFO]: Mixing server.MixinServerGamePacketListenerImpl from mixins/common/nochatreports.mixins.json into net.minecraft.class_3244
[15:29:16] [main/WARN]: Method overwrite conflict for getConnection in fabric-networking-api-v1.mixins.json:accessor.ServerPlayNetworkHandlerAccessor from mod fabric-networking-api-v1, previously written by carpet.mixins.ServerGamePacketListenerImpl_coreMixin. Skipping method.
[15:29:16] [main/WARN]: Method overwrite conflict for getConnection in krypton.mixins.json:shared.network.util.ServerPlayNetworkHandlerAccessor from mod krypton, previously written by carpet.mixins.ServerGamePacketListenerImpl_coreMixin. Skipping method.
[15:29:16] [main/INFO]: Initializing Chat Control
[15:29:16] [main/INFO]: Loading Collective version 6.54.
[15:29:16] [main/INFO]: Loaded C2B lib.
[15:29:16] [main/INFO]: Loading custom commands
[15:29:16] [main/INFO]: Loaded /discord
[15:29:16] [main/INFO]: Loaded /worldseed
[15:29:16] [main/INFO]: [EasyAuth]: EasyAuth mod by samo_lego, NikitaCartes.
[15:29:16] [main/INFO]: [EasyWhitelist] Whitelist is now name-based.
[15:29:17] [main/INFO]: Loading extensions...
[15:29:17] [main/INFO]: Loaded 0 extension(s)
[15:29:17] [main/INFO]: Compression will use libdeflate (Linux x86_64), encryption will use OpenSSL 1.1.x (Linux x86_64)
[15:29:17] [main/INFO]: KONNICHIWA ZA WARUDO!
[15:29:17] [main/INFO]: Default JVM text encoding is: UTF-8
[15:29:17] [main/INFO]: Reading config file NoChatReports/NCR-Common.json...
[15:29:17] [main/INFO]: Writing config file NoChatReports/NCR-Common.json...
[15:29:18] [main/INFO]: Done initializing TabTPS.
[15:29:18] [main/INFO]: Successfully initialized antixray on fabric
[15:29:18] [main/INFO]: Krypton is now accelerating your Minecraft server's networking stack 🚀
[15:29:18] [main/INFO]: Initializing Ledger 1.2.7
[15:29:19] [main/INFO]: -----------------------------------------
[15:29:19] [main/INFO]: MCDiscordChat (MCDC) 2.1.4
[15:29:19] [main/INFO]: By Xujiayao
[15:29:19] [main/INFO]: 
[15:29:19] [main/INFO]: More information + Docs:
[15:29:19] [main/INFO]: https://blog.xujiayao.top/posts/4ba0a17a/
[15:29:19] [main/INFO]: -----------------------------------------
[15:29:19] [main/INFO]: Login Successful!
[15:29:20] [JDA MainWS-ReadThread/INFO]: Connected to WebSocket
[15:29:21] [JDA MainWS-ReadThread/INFO]: Finished Loading!
[15:29:21] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[15:29:22] [main/INFO]: Loaded 7 recipes
[15:29:22] [main/INFO]: Loaded 1179 advancements
[15:29:23] [ForkJoinPool.commonPool-worker-1/INFO]: Loaded 101 translation keys
[15:29:23] [main/INFO]: Mixing server.MixinDedicatedServer from mixins/common/nochatreports.mixins.json into net.minecraft.class_3176
[15:29:23] [main/INFO]: Mixing server.MixinPlayerList from mixins/common/nochatreports.mixins.json into net.minecraft.class_3324
[15:29:23] [main/INFO]: Applied 0 biome modifications to 0 of 63 new biomes in 1.804 ms
[15:29:23] [Server thread/INFO]: BanHammer connected successfully to SQLite database!
[15:29:23] [Server thread/INFO]: Preparing create tables statements took 9ms
[15:29:23] [Server thread/INFO]: Executing create tables statements took 8ms
[15:29:23] [Server thread/INFO]: Extracting table columns took 5ms
[15:29:23] [Server thread/INFO]: Preparing alter table statements took 6ms
[15:29:23] [Server thread/INFO]: Executing alter table statements took 0ms
[15:29:23] [Server thread/INFO]: Index on table 'players' differs only in name: in db players_player_id -> in mapping players_player_id_unique
[15:29:23] [Server thread/INFO]: Index on table 'ActionIdentifiers' differs only in name: in db ActionIdentifiers_action_identifier -> in mapping ActionIdentifiers_action_identifier_unique
[15:29:23] [Server thread/INFO]: Index on table 'ObjectIdentifiers' differs only in name: in db ObjectIdentifiers_identifier -> in mapping ObjectIdentifiers_identifier_unique
[15:29:23] [Server thread/INFO]: Index on table 'sources' differs only in name: in db sources_name -> in mapping sources_name_unique
[15:29:23] [Server thread/INFO]: Index on table 'worlds' differs only in name: in db worlds_identifier -> in mapping worlds_identifier_unique
[15:29:23] [Server thread/INFO]: Checking mapping consistence took 147ms
[15:29:23] [Server thread/INFO]: Tables created
[15:29:23] [DefaultDispatcher-worker-1/INFO]: Inserting 1471 registry keys into the database...
[15:29:23] [Server thread/INFO]: Starting minecraft server version 1.19.4
[15:29:23] [Server thread/INFO]: Loading properties
[15:29:23] [Server thread/INFO]: Default game type: SURVIVAL
[15:29:23] [Server thread/INFO]: Generating keypair
[15:29:23] [Server thread/INFO]: Starting Minecraft server on 0.0.*.*:25607
[15:29:24] [Server thread/INFO]: Using epoll channel type
[15:29:24] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[15:29:24] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
[15:29:24] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[15:29:24] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[15:29:24] [Server thread/INFO]: Preparing level "world"
[15:29:24] [Server thread/INFO]: [CM] Loaded 4 settings from carpet.conf
[15:29:25] [DefaultDispatcher-worker-2/INFO]: Registry insert complete
[15:29:26] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[15:29:30] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-3/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-3/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-3/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[15:29:30] [Worker-Main-1/INFO]: Preparing spawn area: 0%
[15:29:31] [Worker-Main-3/INFO]: Preparing spawn area: 4%
[15:29:31] [Worker-Main-1/INFO]: Preparing spawn area: 52%
[15:29:32] [Server thread/INFO]: Time elapsed: 5315 ms
[15:29:32] [Server thread/INFO]: [MemoryLeakFix] Attempting to ForceLoad All Mixins and clear cache
[15:29:32] [Server thread/INFO]: Mixing server.MixinServerboundChatSessionUpdatePacket from mixins/common/nochatreports.mixins.json into net.minecraft.class_7861
[15:29:32] [Server thread/INFO]: Mixing common.MixinServerStatus from mixins/common/nochatreports.mixins.json into net.minecraft.class_2926
[15:29:32] [Server thread/INFO]: Mixing server.MixinServerboundChatCommandPacket from mixins/common/nochatreports.mixins.json into net.minecraft.class_7472
[15:29:32] [Server thread/INFO]: Mixing server.MixinServerboundChatPacket from mixins/common/nochatreports.mixins.json into net.minecraft.class_2797
[15:29:32] [Server thread/INFO]: [MemoryLeakFix] Done ForceLoad and clearing SpongePowered cache
[15:29:32] [Server thread/INFO]: Done (8.075s)! For help, type "help"
[15:29:32] [Server thread/INFO]: Starting GS4 status listener
[15:29:32] [Server thread/INFO]: Thread Query Listener started
[15:29:32] [Query Listener #1/INFO]: Query running on 0.0.*.*:25565
[15:29:32] [Server thread/INFO]: Took 27ms to boot Floodgate
[15:29:32] [Server thread/INFO]: ******************************************
[15:29:32] [Server thread/INFO]: 
[15:29:32] [Server thread/INFO]: Loading Geyser version 2.1.0-SNAPSHOT (git-master-b3a66db)
[15:29:32] [Server thread/INFO]: 
[15:29:32] [Server thread/INFO]: ******************************************
[15:29:35] [Server thread/INFO]: Started Geyser on 0.0.*.*:25607
[15:29:35] [Server thread/INFO]: Done (3.526s)! Run /geyser help for help!
[15:29:35] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 3592ms or 71 ticks behind
[15:29:36] [JDA RateLimit-Worker 2/WARN]: Encountered 429 on route PATCH/channels/{channel_id} with bucket 6e836da6cef38ba2f3dfd8568a4e9631:channel_id=1115553414210928701 Retry-After: 502000 ms Scope: shared
[15:29:44] [Server thread/INFO]: RumoaNoa[/*.*.*.*:5
/7630] logged in with entity id 227 at (40.35908629335685, 64.0, 20.060354496352506)
[15:29:44] [Server thread/INFO]: RumoaNoa joined the game
[15:33:06] [Server thread/INFO]: RumoaNoa is now AFK
[15:36:13] [Netty Epoll Server IO #5/INFO]: RumoaNoa is no longer AFK
[15:36:13] [Server thread/INFO]: [RumoaNoa: Reloading chat control config.]
[15:39:13] [Server thread/INFO]: RumoaNoa is now AFK
[15:39:40] [Netty Epoll Server IO #5/INFO]: RumoaNoa is no longer AFK
[15:39:40] [Server thread/INFO]: censor
[15:39:40] [Server thread/INFO]: Filtered message from RumoaNoa (0fc95377-43ad-387c-a125-a4f1a9a0c7c8): censor
[15:39:45] [Server thread/INFO]: censor
[15:39:45] [Server thread/INFO]: Filtered message from RumoaNoa (0fc95377-43ad-387c-a125-a4f1a9a0c7c8): censor
[15:39:54] [Server thread/INFO]: other message
[15:39:54] [Server thread/INFO]:  other message

Config

{
  "generic": {
    "language": "en_us",
    "botToken": "...",
    "botPlayingStatus": ": %onlinePlayerCount%/%maxPlayerCount%",
    "botListeningStatus": "",
    "webhookUrl": "...",
    "channelId": "1115553414210928701",
    "consoleLogChannelId": "",
    "updateNotificationChannelId": "",
    "useUuidInsteadOfName": false,
    "avatarApi": "https://mc-heads.net/avatar/%player%.png",
    "broadcastPlayerCommandExecution": false,
    "broadcastSlashCommandExecution": false,
    "announceServerStartStop": true,
    "announcePlayerJoinLeave": true,
    "announceDeathMessages": true,
    "announceAdvancements": true,
    "broadcastChatMessages": true,
    "formatChatMessages": false,
    "allowMentions": false,
    "useServerNickname": false,
    "discordNewlineLimit": 3,
    "announceHighMspt": true,
    "msptCheckInterval": 5000,
    "msptLimit": 50,
    "notifyUpdates": true,
    "mentionAdminsForUpdates": true,
    "updateChannelTopic": true,
    "channelTopicUpdateInterval": 600000,
    "shutdownImmediately": true,
    "excludedCommands": [
      "/msg",
      "/tell",
      "/tellraw",
      "/w"
    ],
    "adminsIds": [
      "337861931023204352"
    ]
  },
  "multiServer": {
    "enable": false,
    "host": "127.0.0.1",
    "port": 5000,
    "name": "SMP",
    "botIds": []
  },
  "customMessage": {
    "unformattedResponseMessage": "",
    "unformattedChatMessage": "",
    "unformattedOtherMessage": "",
    "unformattedCommandNotice": "",
    "formattedResponseMessage": "",
    "formattedChatMessage": "[{\"text\":\"[%server%] \",\"bold\":true,\"color\":\"blue\"},{\"text\":\"<%name%> \",\"bold\":false,\"color\":\"white\"},{\"text\":\"%message%\",\"bold\":false,\"color\":\"white\"}]",
    "formattedOtherMessage": "[{\"text\":\"[%server%] \",\"bold\":true,\"color\":\"blue\"},{\"text\":\"%message%\",\"bold\":false,\"color\":\"white\"}]",
    "formattedCommandNotice": "",
    "serverStarted": "**[SYSTEM]** Server started! Join us!",
    "serverStopped": "**[SYSTEM]** Server stopped!",
    "joinServer": "**[JOIN]** %playerName% joined the game",
    "leftServer": "**[LEFT]** %playerName% left the game",
    "deathMessage": "**[EVENT]** %deathMessage%",
    "advancementTask": "**[ADVANCEMENT]** %playerName% has made the advancement [%advancement%]",
    "advancementGoal": "**[ADVANCEMENT]** %playerName% has reached the goal [%advancement%]",
    "advancementChallenge": "**[ADVANCEMENT]** %playerName% has completed the challenge [%advancement%]",
    "highMspt": "**[SYSTEM]** Server MSPT (%mspt%) is above %msptLimit%! Server performance might suffered.",
    "offlineChannelTopic": "",
    "onlineChannelTopic": "",
    "onlineChannelTopicForMultiServer": ""
  },
  "latestVersion": "2.1.4",
  "latestCheckTime": 1685739796611
}
Xujiayao commented 1 year ago

It seems impossible to make both mods compatible with each other, as MCDC modifies the ServerPlayNetworkHandler class for in-game chat messages, but Chat Control modifies PlayerManager instead.

Declipsonator commented 1 month ago

Hey there,

I'm the developer of Chat Control and this is no longer an issue. Chat Control switched to ServerPlayNetworkHandler about 4 months ago and now censors the output of this mod.

Cheers!

Xujiayao commented 1 month ago

Hi! Thanks for the information, I will do a check when I have time 😄

Xujiayao commented 1 month ago

After testing with the latest version of Chat Control, normal chat messages are indeed not sent to Discord.

However, be aware that if broadcastPlayerCommandExecution is enabled, command text (such as /tell @a censor) will still be sent to Discord.

Users can use regex and add these words one by one to the excludedCommands list in DMCC config to prevent these commands from being sent to Discord: (Tested working)

"excludedCommands": [
  "\\/msg ([^@].*)",
  "\\/tell ([^@].*)",
  "\\/tellraw ([^@].*)",
  "\\/w ([^@].*)",
  "\\/teammsg (.*)",
  "\\/tm (.*)",
+  ".*censor1.*",
+  ".*censor2.*"
],

Test before adding the item to the excludedCommands list:

image

...
[00:58:33] [Server thread/INFO]: <Xujiayao> test
[00:58:34] [Server thread/INFO]: Filtered Message From: Xujiayao (69ca1318-24ef-4560-b35e-85865d85ab49): censor
[00:58:58] [Server thread/INFO]: <Xujiayao> /say test
[00:58:58] [Server thread/INFO]: [Xujiayao] test
[00:59:44] [Server thread/INFO]: <Xujiayao> /say censor
[00:59:44] [Server thread/INFO]: Filtered Message From: Xujiayao (69ca1318-24ef-4560-b35e-85865d85ab49): censor
[00:59:50] [Server thread/INFO]: [Server] test
[00:59:57] [Server thread/INFO]: [Server] censor
[01:00:27] [Server thread/INFO]: <Xujiayao> /tellraw @a {"text":"censor"}
[01:00:27] [Server thread/INFO]: Filtered Message From: Xujiayao (69ca1318-24ef-4560-b35e-85865d85ab49): tellra@a {"text":"censor"}
[01:00:33] [Server thread/INFO]: <Xujiayao> /tellraw @a {"text":"test"}
...