diff --git a/Core/bottypes/EventsBot.cs b/Core/bottypes/EventsBot.cs index 299383f..f40b17c 100644 --- a/Core/bottypes/EventsBot.cs +++ b/Core/bottypes/EventsBot.cs @@ -223,6 +223,10 @@ namespace BetterSecondBot.bottypes } protected void On_MessageEvent(MessageEventArgs e) { + if((myconfig.OBJECT_CHAT == false) && (e.avatar == false) && (e.group == false) && (e.localchat == true)) + { + return; + } EventHandler handler = _MessageEvent; handler?.Invoke(this, e); } diff --git a/Dockerfile b/Dockerfile index 5b61736..7052775 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ ENV Log2File_Level='1' ENV Setting_LogCommands='false' ENV Agent_Channel='auto' ENV Agent_Version='auto' +ENV OBJECT_CHAT='false' ENV SQLDB_Enabled='false' ENV SQLDB_Host='127.0.0.1' ENV SQLDB_Port='3306' diff --git a/Shared/Json/JsonConfig.cs b/Shared/Json/JsonConfig.cs index 7cff3f4..a6e2c26 100644 --- a/Shared/Json/JsonConfig.cs +++ b/Shared/Json/JsonConfig.cs @@ -107,8 +107,10 @@ namespace BetterSecondBotShared.Json public string Agent_Channel { get; set; } public string Agent_Version { get; set; } - // Database + // Object Chat + public bool OBJECT_CHAT { get; set; } + // Database public bool SQLDB_Enabled { get; set; } public string SQLDB_Host { get; set; } public int SQLDB_Port { get; set; } diff --git a/Shared/Json/JsonConfigApi.cs b/Shared/Json/JsonConfigApi.cs index 3121684..8064f9f 100644 --- a/Shared/Json/JsonConfigApi.cs +++ b/Shared/Json/JsonConfigApi.cs @@ -171,6 +171,7 @@ namespace BetterSecondBotShared.Json + "3: +Warnings\n" + "4: +Debug\n"; } + else if (cmd == "OBJECT_CHAT") { return "Enable object chat to be passed over messages event"; } else if (cmd == "Agent_Channel") { return "What channel to use for the client - should only be used if badly coded grids that are unable to accept custom clients: leave auto otherwise"; } else if (cmd == "Agent_Version") { return "What version to use for the client - should only be used if badly coded grids that are unable to accept custom clients: leave auto otherwise"; } return "Unknown value:" + cmd; @@ -302,6 +303,7 @@ namespace BetterSecondBotShared.Json else if (cmd == "Log2File_Level") { return "1"; } else if (cmd == "Agent_Channel") { return "auto"; } else if (cmd == "Agent_Version") { return "auto"; } + else if (cmd == "OBJECT_CHAT") { return "False"; } return "Unknown value:" + cmd; } #endregion