mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-18 15:00:00 +00:00
rename get_snowflake
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
c6f838f333
commit
77f414925f
2 changed files with 3 additions and 10 deletions
|
@ -206,18 +206,11 @@ export const TemplateFunctions: TemplateFunction[] = [
|
||||||
examples: ['map(user, "id")'],
|
examples: ['map(user, "id")'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "find_i",
|
name: "trim_text",
|
||||||
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",
|
|
||||||
description: "Trims all non-numeric characters from a string",
|
description: "Trims all non-numeric characters from a string",
|
||||||
returnValue: "string",
|
returnValue: "string",
|
||||||
arguments: ["string"],
|
arguments: ["string"],
|
||||||
examples: ['get_snowflake("<@!344837487526412300>")'],
|
examples: ['trim_text("<@!344837487526412300>")'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "tag",
|
name: "tag",
|
||||||
|
|
|
@ -481,7 +481,7 @@ const baseValues = {
|
||||||
const mod = Math.floor(Math.random() * cases.length) + 1;
|
const mod = Math.floor(Math.random() * cases.length) + 1;
|
||||||
return baseValues.cases(mod, ...cases);
|
return baseValues.cases(mod, ...cases);
|
||||||
},
|
},
|
||||||
get_snowflake(str) {
|
trim_text(str) {
|
||||||
if (!str || typeof str !== "string") return "";
|
if (!str || typeof str !== "string") return "";
|
||||||
return str.replaceAll(/[^\d]+/g, "");
|
return str.replaceAll(/[^\d]+/g, "");
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue