3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Add various new tag functions (#195)

This commit is contained in:
Usoka 2021-05-07 06:21:55 +12:00 committed by GitHub
parent eab26a28df
commit 38ab38645b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View file

@ -308,6 +308,18 @@ const baseValues = {
if (end != null && isNaN(end)) return "";
return arg1.slice(parseInt(start, 10), end && parseInt(end, 10));
},
lower(arg) {
if (typeof arg !== "string") return arg;
return arg.toLowerCase();
},
upper(arg) {
if (typeof arg !== "string") return arg;
return arg.toUpperCase();
},
upperFirst(arg) {
if (typeof arg !== "string") return arg;
return arg.charAt(0).toUpperCase() + arg.slice(1);
},
rand(from, to, seed = null) {
if (isNaN(from)) return 0;