mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-04-30 03: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}'");
|
||||
if (_wsClient == null) throw new WebSocketNotInitializedException();
|
||||
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}");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user