Restricted usage of quit/exit commands in the TelegramBridge chat bot due to Telegram caching causing problems

This commit is contained in:
Anon 2023-03-02 20:04:24 +01:00
parent 4f608687ee
commit 91791e99c7

View file

@ -345,6 +345,17 @@ namespace MinecraftClient.ChatBots
{
var command = text[1..];
if (command.ToLower().Contains("quit") || command.ToLower().Contains("exit"))
{
await botClient.SendTextMessageAsync(
chatId: chatId,
replyToMessageId: message.MessageId,
text: "This command has been disabled due to Telegram caching causing issues, please stop your client manually.",
cancellationToken: _cancellationToken,
parseMode: ParseMode.Markdown);
return;;
}
CmdResult result = new();
PerformInternalCommand(command, ref result);