From 77f414925f83b648a108497e8b54b16dc6068a4f Mon Sep 17 00:00:00 2001 From: Tiago R Date: Mon, 9 Oct 2023 09:55:55 +0000 Subject: [PATCH] rename get_snowflake Signed-off-by: GitHub --- backend/src/plugins/Tags/templateFunctions.ts | 11 ++--------- backend/src/templateFormatter.ts | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/backend/src/plugins/Tags/templateFunctions.ts b/backend/src/plugins/Tags/templateFunctions.ts index e0f20ca4..ebf1415a 100644 --- a/backend/src/plugins/Tags/templateFunctions.ts +++ b/backend/src/plugins/Tags/templateFunctions.ts @@ -206,18 +206,11 @@ export const TemplateFunctions: TemplateFunction[] = [ examples: ['map(user, "id")'], }, { - name: "find_i", - description: "Returns the index of the first argument in the array", - returnValue: "number", - arguments: ["array", "value"], - examples: ['find_i(["Hello", "World"], "World")'], - }, - { - name: "get_snowflake", + name: "trim_text", description: "Trims all non-numeric characters from a string", returnValue: "string", arguments: ["string"], - examples: ['get_snowflake("<@!344837487526412300>")'], + examples: ['trim_text("<@!344837487526412300>")'], }, { name: "tag", diff --git a/backend/src/templateFormatter.ts b/backend/src/templateFormatter.ts index 7ff24761..a69640a6 100644 --- a/backend/src/templateFormatter.ts +++ b/backend/src/templateFormatter.ts @@ -481,7 +481,7 @@ const baseValues = { const mod = Math.floor(Math.random() * cases.length) + 1; return baseValues.cases(mod, ...cases); }, - get_snowflake(str) { + trim_text(str) { if (!str || typeof str !== "string") return ""; return str.replaceAll(/[^\d]+/g, ""); },