From eda7356fd403cddd00026ad2fc2795621b429b29 Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 15 Nov 2025 12:51:33 -0600 Subject: [PATCH 1/6] Update TipModule.cs to chunk lists of keywords In the increasing likelihood of long lists of available tip keywords, chunk the output of the list of keywords into multiple messages. --- DiscordBot/Modules/TipModule.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/DiscordBot/Modules/TipModule.cs b/DiscordBot/Modules/TipModule.cs index c5350d85..92bef77e 100644 --- a/DiscordBot/Modules/TipModule.cs +++ b/DiscordBot/Modules/TipModule.cs @@ -176,8 +176,26 @@ public async Task ListTips(params string[] keywords) foreach (var tip in tips) foreach (var term in tip.Keywords) terms.Add(term); - var termList = string.Join("`, `", terms.OrderBy(k => k)); - await ReplyAsync($"Total of {tips.Count} tips found, add one or more keywords to narrow the search.\n`{termList}`"); + await ReplyAsync($"Total of {tips.Count} tips found, add one or more keywords to narrow the search."); + var termList = new List(); + foreach (var tip in terms.OrderBy(k => k)) + termList.Add(term); + while (termList.Count > 0) + { + int count = termList.Count; + if (count > 150) + count = 150-10; + string keywordList = "Keywords: "; + for (int i = 0; i < count; i++) + { + keywordList = $"`{termList[0]}`, "; + termList.RemoveAt(0); + } + keywordList = keywordList.Substring(0, keywordList.Length-2); + await ReplyAsync(keywordList); + if (termList.Count > 0) + await Task.Delay(500); + } return; } } From 0078401b2b741ba2fd9f24632149c15ee4553f7a Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 15 Nov 2025 12:54:18 -0600 Subject: [PATCH 2/6] Update TipModule.cs --- DiscordBot/Modules/TipModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DiscordBot/Modules/TipModule.cs b/DiscordBot/Modules/TipModule.cs index 92bef77e..9f29be60 100644 --- a/DiscordBot/Modules/TipModule.cs +++ b/DiscordBot/Modules/TipModule.cs @@ -179,7 +179,7 @@ public async Task ListTips(params string[] keywords) await ReplyAsync($"Total of {tips.Count} tips found, add one or more keywords to narrow the search."); var termList = new List(); foreach (var tip in terms.OrderBy(k => k)) - termList.Add(term); + termList.Add(tip); while (termList.Count > 0) { int count = termList.Count; From 3113f3acc0e6d1bb9ac7d25b61e445eacde1196d Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:02:58 -0600 Subject: [PATCH 3/6] Update TipModule.cs --- DiscordBot/Modules/TipModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DiscordBot/Modules/TipModule.cs b/DiscordBot/Modules/TipModule.cs index 9f29be60..de8f18fc 100644 --- a/DiscordBot/Modules/TipModule.cs +++ b/DiscordBot/Modules/TipModule.cs @@ -180,11 +180,12 @@ public async Task ListTips(params string[] keywords) var termList = new List(); foreach (var tip in terms.OrderBy(k => k)) termList.Add(tip); + floodCount = 8; while (termList.Count > 0) { int count = termList.Count; - if (count > 150) - count = 150-10; + if (count > floodCount) + count = floodCount-2; string keywordList = "Keywords: "; for (int i = 0; i < count; i++) { From 7d6d197c0e2f05210a898e8449e4bd11cbc00b64 Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:07:49 -0600 Subject: [PATCH 4/6] Update TipModule.cs --- DiscordBot/Modules/TipModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DiscordBot/Modules/TipModule.cs b/DiscordBot/Modules/TipModule.cs index de8f18fc..ab0b8bdd 100644 --- a/DiscordBot/Modules/TipModule.cs +++ b/DiscordBot/Modules/TipModule.cs @@ -149,7 +149,7 @@ public async Task ListTips(params string[] keywords) if (!IsAuthorized(user)) return; - int floodCount = 20; + int floodCount = 10; List tips = null; if (keywords?.Length > 0) From 9b64634dce68b90f1bd8ddb87cd653d605fc6e94 Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:14:20 -0600 Subject: [PATCH 5/6] Update TipModule.cs --- DiscordBot/Modules/TipModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DiscordBot/Modules/TipModule.cs b/DiscordBot/Modules/TipModule.cs index ab0b8bdd..abfa8980 100644 --- a/DiscordBot/Modules/TipModule.cs +++ b/DiscordBot/Modules/TipModule.cs @@ -189,7 +189,7 @@ public async Task ListTips(params string[] keywords) string keywordList = "Keywords: "; for (int i = 0; i < count; i++) { - keywordList = $"`{termList[0]}`, "; + keywordList += $"`{termList[0]}`, "; termList.RemoveAt(0); } keywordList = keywordList.Substring(0, keywordList.Length-2); From c2b354d1fd847ff44ac1f0cb5ff46c90f1d48e97 Mon Sep 17 00:00:00 2001 From: Ed Halley <1223980+hariedo@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:22:31 -0600 Subject: [PATCH 6/6] Update TipModule.cs --- DiscordBot/Modules/TipModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DiscordBot/Modules/TipModule.cs b/DiscordBot/Modules/TipModule.cs index abfa8980..16136d74 100644 --- a/DiscordBot/Modules/TipModule.cs +++ b/DiscordBot/Modules/TipModule.cs @@ -149,7 +149,7 @@ public async Task ListTips(params string[] keywords) if (!IsAuthorized(user)) return; - int floodCount = 10; + int floodCount = 20; List tips = null; if (keywords?.Length > 0) @@ -180,12 +180,12 @@ public async Task ListTips(params string[] keywords) var termList = new List(); foreach (var tip in terms.OrderBy(k => k)) termList.Add(tip); - floodCount = 8; + floodCount = 150; while (termList.Count > 0) { int count = termList.Count; if (count > floodCount) - count = floodCount-2; + count = floodCount-10; string keywordList = "Keywords: "; for (int i = 0; i < count; i++) {