Advertisement
AEAEAEAEarray

MPP PUBLIC BOT

Nov 23rd, 2021
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //local storage used for economy database
  2. const ls = localStorage;
  3.  
  4. //some important function for localstorage (must needed to economy bot)
  5. /**
  6.  *
  7.  * @param {string} item
  8.  */
  9. function existItemInLocalSotage(item) {
  10.     if (ls.getItem(item) === null) return false;
  11.     else return true;
  12. }
  13.  
  14. //set prefix of the bot
  15. (function setPrefix() {
  16.     if (existItemInLocalSotage("prefix")) return;
  17.     alert("Thanks for using this bot (Made by anonydiamond)");
  18.     const takePrefix = prompt("Please enter a prefix for your bot: ");
  19.     if (!takePrefix) {
  20.         alert("Sorry you have to enter a prefix (no prefix entered)!\nBy default set prefix to '!'\nYou can change prefix by using command prefix");
  21.         ls.setItem("prefix", "!");
  22.     } else {
  23.         alert(`Prefix being used "${takePrefix}"\nYou still can change prefix using prefix command`);
  24.         ls.setItem("prefix", takePrefix);
  25.     }
  26.     if (confirm(`Would you like to use "help" at the last of your name?\nYour name is ${MPP.client.getOwnParticipant().name}. If you want use this you name will look like this: ${MPP.client.getOwnParticipant().name} 「 ${ls.getItem("prefix")}help 」 `)) {
  27.         MPP.client.sendArray([{m: "userset", set:{name: `${MPP.client.getOwnParticipant().name} 「 ${ls.getItem("prefix")}help 」`}}]);
  28.         alert("Your name being used: \n" + `${MPP.client.getOwnParticipant().name} 「 ${ls.getItem("prefix")}help 」`);
  29.     } else {
  30.         alert("Nothing changed!");
  31.     }
  32.     alert("Setup complete! Let's begin to use this bot");
  33.     alert("Please allow notification permission");
  34.     Notification.requestPermission()
  35.     .then(per => {
  36.         console.log(per);
  37.     })
  38.     if (Notification.permission !== "denied") {
  39.     new Notification("New message from Anonydiamond!", {
  40.         body: "Need help? Contact: anonydiamond@gmail.com",
  41.     })
  42.     .onclick = () => {
  43.         alert("If you need any help, please contact at- anonydiamond@gmail.com");
  44.     }
  45. }
  46. })();
  47.  
  48. const prefix = ls.prefix; //please do not change (prefix will taken from all user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement