Skip to content

Commit 61c2cbf

Browse files
authored
bugfix: Fixed Telegram Bridge not displaying player names properly for players with an underscore in their nick names
Update TelegramBridge.cs
2 parents 80c0763 + 2e38340 commit 61c2cbf

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

MinecraftClient/ChatBots/TelegramBridge.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public override void GetText(string text)
194194

195195
else message = text;
196196

197-
SendMessage(message);
197+
SendRawMessage(message);
198198
}
199199

200200
public void SendMessage(string message)
@@ -213,6 +213,22 @@ public void SendMessage(string message)
213213
}
214214
}
215215

216+
public void SendRawMessage(string message)
217+
{
218+
if (!CanSendMessages() || string.IsNullOrEmpty(message))
219+
return;
220+
221+
try
222+
{
223+
botClient!.SendMessage(Config.ChannelId.Trim(), message).Wait(Config.Message_Send_Timeout);
224+
}
225+
catch (Exception e)
226+
{
227+
LogToConsole("§§4§l§f" + Translations.bot_TelegramBridge_canceled_sending);
228+
LogDebugToConsole(e);
229+
}
230+
}
231+
216232
public void SendImage(string filePath, string? text = null)
217233
{
218234
if (!CanSendMessages())

0 commit comments

Comments
 (0)