mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Change logger for edit length to only log if it's too long
This commit is contained in:
@@ -250,7 +250,11 @@ public class ChatClient
|
|||||||
_logger.Debug($"Editing {messageId} with '{newMessage}'");
|
_logger.Debug($"Editing {messageId} with '{newMessage}'");
|
||||||
if (_wsClient == null) throw new WebSocketNotInitializedException();
|
if (_wsClient == null) throw new WebSocketNotInitializedException();
|
||||||
var msg = $"/edit {payload}";
|
var msg = $"/edit {payload}";
|
||||||
_logger.Info($"Edit message will be {Encoding.UTF8.GetByteCount(msg)} bytes long");
|
var length = Encoding.UTF8.GetByteCount(msg);
|
||||||
|
if (length > 1023)
|
||||||
|
{
|
||||||
|
_logger.Error($"Edit message is too long at {length} bytes");
|
||||||
|
}
|
||||||
await _wsClient.SendInstant($"/edit {payload}");
|
await _wsClient.SendInstant($"/edit {payload}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user