mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Updated 1023-byte limits to 2048
This commit is contained in:
@@ -405,7 +405,7 @@ public class ChatBot
|
|||||||
/// <param name="lengthLimit">Length limit to enforce in bytes</param>
|
/// <param name="lengthLimit">Length limit to enforce in bytes</param>
|
||||||
/// <param name="autoDeleteAfter">Length of time until the message is auto deleted, null to disable. Starts counting from when the message is echoed by Sneedchat</param>
|
/// <param name="autoDeleteAfter">Length of time until the message is auto deleted, null to disable. Starts counting from when the message is echoed by Sneedchat</param>
|
||||||
/// <returns>An object you can use to check the status of the message and get its ID for editing/deleting later</returns>
|
/// <returns>An object you can use to check the status of the message and get its ID for editing/deleting later</returns>
|
||||||
public async Task<SentMessageTrackerModel> SendChatMessageAsync(string message, bool bypassSeshDetect = false, LengthLimitBehavior lengthLimitBehavior = LengthLimitBehavior.TruncateNicely, int lengthLimit = 1023, TimeSpan? autoDeleteAfter = null)
|
public async Task<SentMessageTrackerModel> SendChatMessageAsync(string message, bool bypassSeshDetect = false, LengthLimitBehavior lengthLimitBehavior = LengthLimitBehavior.TruncateNicely, int lengthLimit = 2048, TimeSpan? autoDeleteAfter = null)
|
||||||
{
|
{
|
||||||
var settings = await SettingsProvider
|
var settings = await SettingsProvider
|
||||||
.GetMultipleValuesAsync([
|
.GetMultipleValuesAsync([
|
||||||
@@ -501,7 +501,7 @@ public class ChatBot
|
|||||||
/// <param name="autoDeleteAfter">Length of time until the message is auto deleted, null to disable. Starts counting from when the message is echoed by Sneedchat</param>
|
/// <param name="autoDeleteAfter">Length of time until the message is auto deleted, null to disable. Starts counting from when the message is echoed by Sneedchat</param>
|
||||||
/// <returns>An object you can use to check the status of the message and get its ID for editing/deleting later</returns>
|
/// <returns>An object you can use to check the status of the message and get its ID for editing/deleting later</returns>
|
||||||
public SentMessageTrackerModel SendChatMessage(string message, bool bypassSeshDetect = false,
|
public SentMessageTrackerModel SendChatMessage(string message, bool bypassSeshDetect = false,
|
||||||
LengthLimitBehavior lengthLimitBehavior = LengthLimitBehavior.TruncateNicely, int lengthLimit = 1023, TimeSpan? autoDeleteAfter = null)
|
LengthLimitBehavior lengthLimitBehavior = LengthLimitBehavior.TruncateNicely, int lengthLimit = 2048, TimeSpan? autoDeleteAfter = null)
|
||||||
{
|
{
|
||||||
return SendChatMessageAsync(message, bypassSeshDetect, lengthLimitBehavior, lengthLimit, autoDeleteAfter).Result;
|
return SendChatMessageAsync(message, bypassSeshDetect, lengthLimitBehavior, lengthLimit, autoDeleteAfter).Result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public static class Extensions
|
|||||||
/// <param name="partLimit">Limit for how many parts to return (returns first n elements). Set to 0 to disable.</param>
|
/// <param name="partLimit">Limit for how many parts to return (returns first n elements). Set to 0 to disable.</param>
|
||||||
/// <param name="partSeparator">Separator to use when splitting up parts of the message</param>
|
/// <param name="partSeparator">Separator to use when splitting up parts of the message</param>
|
||||||
/// <returns>List of string values which represents the split up message</returns>
|
/// <returns>List of string values which represents the split up message</returns>
|
||||||
public static List<string> FancySplitMessage(this string s, int partLengthBytes = 1023, int partLimit = 5, string partSeparator = " ")
|
public static List<string> FancySplitMessage(this string s, int partLengthBytes = 2048, int partLimit = 5, string partSeparator = " ")
|
||||||
{
|
{
|
||||||
var output = new List<string>();
|
var output = new List<string>();
|
||||||
var part = string.Empty;
|
var part = string.Empty;
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public class ChatClient
|
|||||||
if (_wsClient == null) throw new WebSocketNotInitializedException();
|
if (_wsClient == null) throw new WebSocketNotInitializedException();
|
||||||
var msg = $"/edit {payload}";
|
var msg = $"/edit {payload}";
|
||||||
var length = Encoding.UTF8.GetByteCount(msg);
|
var length = Encoding.UTF8.GetByteCount(msg);
|
||||||
if (length > 1023)
|
if (length > 2048)
|
||||||
{
|
{
|
||||||
_logger.Error($"Edit message is too long at {length} bytes");
|
_logger.Error($"Edit message is too long at {length} bytes");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user