summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-11-18 15:59:51 -0300
committerJesusaves <cpntb1@ymail.com>2021-11-18 15:59:51 -0300
commit85424958f4710ac809c21e156c29a9c418a6cd2a (patch)
treeea70b6c8902a734dd9d2721190a499610ab1e4eb
parent72e2bb113b7102cb90def3727fd917c79df77125 (diff)
downloadserverdata-85424958f4710ac809c21e156c29a9c418a6cd2a.tar.gz
serverdata-85424958f4710ac809c21e156c29a9c418a6cd2a.tar.bz2
serverdata-85424958f4710ac809c21e156c29a9c418a6cd2a.tar.xz
serverdata-85424958f4710ac809c21e156c29a9c418a6cd2a.zip
Fix typo on @discord and add some basic validation
-rw-r--r--npc/commands/discord.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/npc/commands/discord.txt b/npc/commands/discord.txt
index 0de4b9ca0..0aa56660e 100644
--- a/npc/commands/discord.txt
+++ b/npc/commands/discord.txt
@@ -74,9 +74,12 @@ OnCall:
atcommand("@ban 7d "+strcharinfo(0));
mesc l("Please insert your Discord ID, on the following format: "), 1;
- mesc l("Usename#0000"), 2;
+ mesc l("Username#0000"), 2;
input .@discord$;
if (.@discord$ == "") close;
+ .@i = explode(.@d$, .@discord$, "#");
+ if (.@i != 2) { mesc l("Invalid Discord ID. (L1)"); next; break; }
+ if (getstrlen(.@d$[1]) != 4) { mesc l("Invalid Discord ID. (L2)"); next; break; }
mes "";
clear;
mesc l("Linking the following Discord account:");