Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //local storage used for economy database
- const ls = localStorage;
- //some important function for localstorage (must needed to economy bot)
- /**
- *
- * @param {string} item
- */
- function existItemInLocalSotage(item) {
- if (ls.getItem(item) === null) return false;
- else return true;
- }
- //set prefix of the bot
- (function setPrefix() {
- if (existItemInLocalSotage("prefix")) return;
- alert("Thanks for using this bot (Made by anonydiamond)");
- const takePrefix = prompt("Please enter a prefix for your bot: ");
- if (!takePrefix) {
- alert("Sorry you have to enter a prefix (no prefix entered)!\nBy default set prefix to '!'\nYou can change prefix by using command prefix");
- ls.setItem("prefix", "!");
- } else {
- alert(`Prefix being used "${takePrefix}"\nYou still can change prefix using prefix command`);
- ls.setItem("prefix", takePrefix);
- }
- 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 」 `)) {
- MPP.client.sendArray([{m: "userset", set:{name: `${MPP.client.getOwnParticipant().name} 「 ${ls.getItem("prefix")}help 」`}}]);
- alert("Your name being used: \n" + `${MPP.client.getOwnParticipant().name} 「 ${ls.getItem("prefix")}help 」`);
- } else {
- alert("Nothing changed!");
- }
- alert("Setup complete! Let's begin to use this bot");
- alert("Please allow notification permission");
- Notification.requestPermission()
- .then(per => {
- console.log(per);
- })
- if (Notification.permission !== "denied") {
- new Notification("New message from Anonydiamond!", {
- body: "Need help? Contact: anonydiamond@gmail.com",
- })
- .onclick = () => {
- alert("If you need any help, please contact at- anonydiamond@gmail.com");
- }
- }
- })();
- const prefix = ls.prefix; //please do not change (prefix will taken from all user)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement