From 11fd926030c45495be112f396b1800a61a8b4f70 Mon Sep 17 00:00:00 2001 From: Ashish <51633862+ashishjh-bst@users.noreply.github.com> Date: Fri, 19 Apr 2024 22:55:10 +0530 Subject: [PATCH] Added support for 20k chars long ccs for premium servers (#1641) Co-authored-by: Ashish Jhanwar --- .../assets/customcommands-editcmd.html | 6 +- .../assets/customcommands-public.html | 8 +- customcommands/assets/customcommands.html | 7 + customcommands/bot.go | 17 +-- customcommands/customcommands.go | 133 +++++------------- customcommands/migration.go | 76 ---------- customcommands/web.go | 25 +++- premium/plugin_bot.go | 2 +- premium/premium.go | 5 - rolecommands/menu.go | 2 +- web/validation.go | 4 +- 11 files changed, 83 insertions(+), 202 deletions(-) delete mode 100644 customcommands/migration.go diff --git a/customcommands/assets/customcommands-editcmd.html b/customcommands/assets/customcommands-editcmd.html index b43982640e..41b905ce37 100644 --- a/customcommands/assets/customcommands-editcmd.html +++ b/customcommands/assets/customcommands-editcmd.html @@ -277,7 +277,7 @@

+ class="cc-length-counter">x/{{.MaxCCLength}}) {{range .CC.Responses}}
@@ -659,8 +659,8 @@

Custom Command Information

var display = document.querySelector(".cc-length-counter") display.textContent = combinedLength - - if (combinedLength > 10000) { + + if (combinedLength > {{.MaxCCLength}}) { display.classList.add("text-danger"); } else { display.classList.remove("text-danger"); diff --git a/customcommands/assets/customcommands-public.html b/customcommands/assets/customcommands-public.html index 9c2e961136..1d251fb0d5 100644 --- a/customcommands/assets/customcommands-public.html +++ b/customcommands/assets/customcommands-public.html @@ -220,7 +220,7 @@

- + {{range $i, $r := .CC.Responses}}