Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nomention
- $var[walatpass;abcd] $c[put your password instead of abcd]
- $textSplit[$customID;+]
- $var[customID;$splitText[1]]
- $var[authorID;$splitText[2]]
- $var[data;$splitText[3]]
- $if[$var[customID]==acc.register]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $removeButtons
- $color[2b2d31]
- $title[Account Creation]
- $description[Username : ```-```
- Password : ```-```]
- $addButton[no;acc.register.enter+$authorID;Enter Username/Password;primary]
- $addButton[no;acc.register.save+$authorID;Save;secondary;yes]
- $addButton[no;delete+$authorID;Close;danger]
- $endif
- $if[$var[customID]==acc.register.enter]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $textSplit[$var[data];-]
- $var[username;$splitText[1]]
- $var[pass;$splitText[2]]
- $newModal[acc.register.modal;Account Creation]
- $addTextInput[username;short;Username;3;16;yes;$var[username];User]
- $addTextInput[pass;short;Password;6;8;yes;$var[pass];Pass123@]
- $endif
- $if[$var[customID]==acc.register.modal]
- $if[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$toLowercase[$input[username]];a;];b;];c;];d;];e;];f;];g;];h;];i;];j;];k;];l;];m;];n;];o;];p;];q;];r;];s;];t;];u;];v;];w;];x;];y;];z;];.;];0;];1;];2;];3;];4;];5;];6;];7;];8;];9;]!=]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid Username Input;You can only have a-z(English alphabet), 0-9(numbers), .(dots) and _(underscores) in your username]
- $elseif[$checkContains[$input[pass];1;2;3;4;5;6;7;8;9;0]==false]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid Password Input;You must enter a number in your password]
- $elseif[$checkContains[$input[pass];+;-;.;~]==true]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid Password Input;You can not use +,-,.,~ symbols in your password]
- $else
- $editMessage[$channelID;$messageID;;Account Creation;Username : ```$toLowercase[$input[username]]```
- Password : ```$replaceText[$replaceText[$replaceText[$charCount[$input[pass]];6;******];7;*******];8;********]```;2b2d31;]
- $var[dataA;$toLowercase[$input[username]]-$input[pass]]
- $removeButtons[$messageID]
- $addButton[no;acc.register.enter+$authorID+$var[dataA];Edit Username/Password;secondary;no;;$messageID]
- $addButton[no;acc.register.save+$authorID+$var[dataA];Save;success;no;;$messageID]
- $addButton[no;delete+$authorID;Close;danger;no;;$messageID]
- $endif
- $endif
- $if[$var[customID]==acc.register.save]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $textSplit[$var[data];-]
- $var[username;$splitText[1]]
- $var[pass;$splitText[2]]
- $var[date;"$getTimestamp"]
- $var[AccID;$random[1111;10000]×$randomString[10]]
- $httpPost[http://api.walat.uk/get_variable/$botID/Accounts;{"password" : "$var[walatpass]"}]
- $jsonParse[$url[decode;$httpResult[Accounts]]]
- $if[$jsonExists[$var[username]]==true]
- $ephemeral
- $removeAllComponents
- $addField[Failed;This username is already taken.]
- $color[2b2d31]
- $else
- $jsonSetString[$var[username];AccID;$var[AccID]]
- $jsonSetString[$var[username];Pass;$var[pass]]
- $jsonSetString[$var[username];Date;$var[date]]
- $jsonArrayAppend[$var[username];Users;"$authorID"]
- $disableInnerSpaceRemoval
- $httpPost[http://api.walat.uk/set_variable/$botID/Accounts;{"password" : "$var[walatpass]","value" : "$url[encode;$jsonStringify]"}]
- $sendMessage[Walat API ```js
- $jsonPretty[]```]
- $if[$httpResult[message]!=Variable set successfully]
- $removeButtons
- $addField[Error;Something went wrong with storing your data. please try again later]
- $color[2b2d31]
- $stop
- $else
- $jsonParse[$getVar[Acc;$authorID]]
- $jsonSetString[Username;$var[username]]
- $jsonSetString[Pass;$var[pass]]
- $jsonSetString[Date;$var[date]]
- $jsonSetString[AccID;$var[AccID]]
- $setVar[Acc;$jsonStringify;$authorID]
- $removeButtons
- $color[2b2d31]
- $addField[Registered;Successfully created the account $var[username] and logged in.]
- $endif
- $endif
- $endif
- $if[$var[customID]==acc.login]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $removeButtons
- $color[2b2d31]
- $title[Account Login]
- $description[Username : ```-```
- Password : ```-```]
- $addButton[no;acc.login.enter+$authorID;Enter Username/Password;primary]
- $addButton[no;acc.login.go+$authorID;Login;secondary;yes]
- $addButton[no;delete+$authorID;Close;danger]
- $endif
- $if[$var[customID]==acc.login.enter]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $textSplit[$var[data];-]
- $var[username;$splitText[1]]
- $var[pass;$splitText[2]]
- $newModal[acc.login.modal;Account Login]
- $addTextInput[username;short;Username;3;16;yes;$var[username];User]
- $addTextInput[pass;short;Password;6;8;yes;$var[pass];Pass123@]
- $endif
- $if[$var[customID]==acc.login.modal]
- $if[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$toLowercase[$input[username]];a;];b;];c;];d;];e;];f;];g;];h;];i;];j;];k;];l;];m;];n;];o;];p;];q;];r;];s;];t;];u;];v;];w;];x;];y;];z;];.;];0;];1;];2;];3;];4;];5;];6;];7;];8;];9;]!=]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid Username Input;You can only have a-z(English alphabet), 0-9(numbers), .(dots) and _(underscores) in your username]
- $elseif[$checkContains[$input[pass];1;2;3;4;5;6;7;8;9;0]==false]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid Password Input;You must enter a number in your password]
- $elseif[$checkContains[$input[pass];+;-;.;~]==true]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid Password Input;You can not use +,-,.,~ symbols in your password]
- $else
- $editMessage[$channelID;$messageID;;Account Login;Username : ```$toLowercase[$input[username]]```
- Password : ```$replaceText[$replaceText[$replaceText[$charCount[$input[pass]];6;******];7;*******];8;********]```;2b2d31;]
- $var[dataA;$toLowercase[$input[username]]-$input[pass]]
- $removeButtons[$messageID]
- $addButton[no;acc.login.enter+$authorID+$var[dataA];Edit Username/Password;secondary;no;;$messageID]
- $addButton[no;acc.login.go+$authorID+$var[dataA];Login;success;no;;$messageID]
- $addButton[no;delete+$authorID;Close;danger;no;;$messageID]
- $endif
- $endif
- $if[$var[customID]==acc.login.go]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $textSplit[$var[data];-]
- $var[username;$splitText[1]]
- $var[pass;$splitText[2]]
- $httpPost[http://api.walat.uk/get_variable/$botID/Accounts;{"password" : "123"}]
- $jsonParse[$url[decode;$httpResult[Accounts]]]
- $if[$jsonExists[$var[username]]==false]
- $ephemeral
- $removeAllComponents
- $addField[Failed;This username does not exist.]
- $color[2b2d31]
- $stop
- $elseif[$json[$var[username];Pass]!=$var[pass]]
- $ephemeral
- $removeAllComponents
- $addField[Failed; Incorrect password.]
- $color[2b2d31]
- $stop
- $elseif[$jsonArrayCount[$var[username];Users]>=10]
- $ephemeral
- $removeAllComponents
- $addField[Failed;This account has reached the maximum users that can be connected to one account which is 10 users.]
- $color[2b2d31]
- $stop
- $else
- $jsonArrayAppend[$var[username];Users;"$authorID"]
- $httpPost[http://api.walat.uk/set_variable/$botID/Accounts;{"password" : "$var[walatpass]","value" : "$url[encode;$jsonStringify]"}]
- $var[AccID;$json[$var[username];AccID]]
- $var[Pass;$json[$var[username];Pass]]
- $var[Date;$json[$var[username];Date]]
- $jsonParse[{}]
- $jsonSetString[Username;$var[username]]
- $jsonSetString[Pass;$var[Pass]]
- $jsonSetString[Date;$var[Date]]
- $jsonSetString[AccID;$var[AccID]]
- $setVar[Acc;$jsonStringify;$authorID]
- $removeButtons
- $color[2b2d31]
- $addField[Logged In;Successfully logged into the account $var[username].]
- $endif
- $endif
- $if[$var[customID]==acc.logout]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $author[$username]
- $authorIcon[$authorAvatar]
- $color[2b2d31]
- $addField[Confirm;Are you sure you want to logout?]
- $removeButtons
- $addButton[no;acc.logout.yes+$authorID;Yes;success]
- $addButton[no;acc.logout.no+$authorID;No;danger]
- $addButton[no;delete+$authorID;Close;danger]
- $endif
- $if[$var[customID]==acc.logout.no]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $removeButtons
- $author[$username]
- $authorIcon[$authorAvatar]
- $color[2b2d31]
- $addField[Cancelled;You have successfully cancelled the logout]
- $endif
- $if[$var[customID]==acc.logout.yes]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $removeButtons
- $author[$username]
- $authorIcon[$authorAvatar]
- $color[2b2d31]
- $addField[Done;You have successfully logged out from your account]
- $try
- $jsonParse[$getVar[Acc;$authorID]]
- $var[username;$json[Username]]
- $httpPost[http://api.walat.uk/get_variable/$botID/Accounts;{"password" : "$var[walatpass]"}]
- $jsonParse[$url[decode;$httpResult[Accounts]]]
- $if[$jsonExists[$var[username]]==true]
- $jsonUnset[$var[username];Users;$jsonArrayIndex[$var[username];Users;"$authorID"]]
- $httpPost[http://api.walat.uk/set_variable/$botID/Accounts;{"password" : "$var[walatpass]","value" : "$url[encode;$jsonStringify]"}]
- $endif
- $endtry
- $setVar[Acc;{};$authorID]
- $endif
- $if[$var[customID]==acc.delete]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $author[$username]
- $authorIcon[$authorAvatar]
- $color[2b2d31]
- $addField[Confirm;Are you sure you want to delete this account?]
- $removeButtons
- $addButton[no;acc.delete.yes+$authorID;Yes;success]
- $addButton[no;acc.delete.no+$authorID;No;danger]
- $addButton[no;delete+$authorID;Close;danger]
- $endif
- $if[$var[customID]==acc.delete.no]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $removeButtons
- $author[$username]
- $authorIcon[$authorAvatar]
- $color[2b2d31]
- $addField[Cancelled;You have successfully cancelled the deletion of the account]
- $endif
- $if[$var[customID]==acc.delete.yes]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $removeButtons
- $author[$username]
- $authorIcon[$authorAvatar]
- $color[2b2d31]
- $addField[Verify;Enter your password to delete the account.]
- $addButton[no;acc.delete.verify+$authorID;Enter Password;success]
- $endif
- $if[$var[customID]==acc.delete.verify]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $newModal[acc.delete.verify.modal;Account Deletion]
- $addTextInput[pass;short;Password;6;8;yes;$var[pass];Pass123@]
- $endif
- $if[$var[customID]==acc.delete.verify.modal]
- $jsonParse[$getVar[Acc;$authorID]]
- $var[pass;$json[Pass]]
- $var[username;$json[Username]]
- $if[$var[pass]!=$input[pass]]
- $addField[Error; Invalid Password]
- $color[2b2d31]
- $elseif[$var[pass]==$input[pass]]
- $removeButtons[$messageID]
- $addField[Done;You have successfully deleted your account]
- $color[2b2d31]
- $setVar[Acc;{};$authorID]
- $try
- $httpPost[http://api.walat.uk/get_variable/$botID/Accounts;{"password" : "$var[walatpass]"}]
- $jsonParse[$url[decode;$httpResult[Accounts]]]
- $jsonUnset[$var[username]]
- $httpPost[http://api.walat.uk/set_variable/$botID/Accounts;{"password" : "$var[walatpass]","value" : "$url[encode;$jsonStringify]"}]
- $endtry
- $endif
- $endif
- $if[$var[customID]==acc.forgot.password]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $ephemeral
- $removeButtons
- $color[2b2d31]
- $author[$username]
- $authorIcon[$authorAvatar]
- $addField[Sorry;Unfortunately we can't remember it for you so try to remember it next time. and yes you will never be able to get the information in that account]
- $endif
- $if[$var[customID]==acc.change.password]
- $if[$var[authorID]!=$authorID]
- $ephemeral
- $removeAllComponents
- $addField[Error;You are not the author of this command]
- $color[2b2d31]
- $stop
- $endif
- $newModal[acc.change.password.modal;Changing Password]
- $addTextInput[oldpass;short;Current Password;6;8;yes;;Pass123@]
- $addTextInput[newpass;short;New Password;6;8;yes;;Pass123@]
- $endif
- $if[$var[customID]==acc.change.password.modal]
- $jsonParse[$getVar[Acc;$authorID]]
- $var[oldPass;$json[Pass]]
- $var[username;$json[Username]]
- $if[$checkContains[$input[newpass];1;2;3;4;5;6;7;8;9;0]==false]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid New Password Input;You must enter a number in your password]
- $elseif[$checkContains[$input[newpass];+;-;.;~]==true]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Invalid New Password Input;You can not use +,-,.,~ symbols in your password]
- $elseif[$var[oldPass]!=$input[oldpass]]
- $ephemeral
- $removeAllComponents
- $color[2b2d31]
- $addField[Failed;Invalid current password input.]
- $else
- $httpPost[http://api.walat.uk/get_variable/$botID/Accounts;{"password" : "$var[walatpass]"}]
- $jsonParse[$url[decode;$httpResult[Accounts]]]
- $if[$jsonExists[$var[username]]==false]
- $ephemeral
- $removeAllComponents
- $addField[Failed;This username does not exist.]
- $color[2b2d31]
- $stop
- $elseif[$json[$var[username];Pass]!=$input[oldpass]]
- $ephemeral
- $removeAllComponents
- $addField[Failed; Incorrect password.]
- $color[2b2d31]
- $stop
- $else
- $jsonSetString[$var[username];Pass;$input[newpass]]
- $httpPost[http://api.walat.uk/set_variable/$botID/Accounts;{"password" : "$var[walatpass]","value" : "$url[encode;$jsonStringify]"}]
- $var[Pass;$json[$var[username];Pass]]
- $jsonParse[$getVar[Acc;$authorID]]
- $jsonSetString[Pass;$input[newpass]]
- $setVar[Acc;$jsonStringify;$authorID]
- $removeButtons
- $color[2b2d31]
- $author[$username]
- $authorIcon[$authorAvatar]
- $addField[Success;Successfully changed the password]
- $endif
- $endif
- $endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement