goat
command
prefix
๐ ๏ธ ๐๐ก๐๐ง๐ ๐ ๐ญ๐ก๐ ๐๐จ๐ญ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ข๐ง ๐ฒ๐จ๐ฎ๐ซ ๐๐ก๐๐ญ ๐๐จ๐ฑ ๐จ๐ซ ๐ญ๐ก๐ ๐๐ง๐ญ๐ข๐ซ๐ ๐ฌ๐ฒ๐ฌ๐ญ๐๐ฆ
0
views
0
likes
0
installs
raw source
const fs = require("fs-extra");
const { utils } = global;
module.exports = {
config: {
name: "prefix",
version: "1.5",
author: "๐๐๐ซ๐ฎ๐
",
countDown: 5,
role: 0,
description: "๐ ๏ธ ๐๐ก๐๐ง๐ ๐ ๐ญ๐ก๐ ๐๐จ๐ญ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ข๐ง ๐ฒ๐จ๐ฎ๐ซ ๐๐ก๐๐ญ ๐๐จ๐ฑ ๐จ๐ซ ๐ญ๐ก๐ ๐๐ง๐ญ๐ข๐ซ๐ ๐ฌ๐ฒ๐ฌ๐ญ๐๐ฆ",
category: "โ๏ธ ๐๐ก๐๐ง๐ ๐ ๐ญ๐ก๐ ๐ฉ๐ซ๐๐๐ข๐ฑ",
guide: {
en:
"โโโโโโโโโโโโโโโโโโโ\n"
+ "๐ {pn} <new prefix>: ๐๐ก๐๐ง๐ ๐ ๐ญ๐ก๐ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ข๐ง ๐ฒ๐จ๐ฎ๐ซ ๐๐ก๐๐ญ ๐๐จ๐ฑ\n"
+ "โโโโโโโโโโโโโโโโโโโ\n"
+ "๐ ๐๐ฑ๐๐ฆ๐ฉ๐ฅ๐:\n"
+ "๐น {pn} #\n"
+ "โโโโโโโโโโโโโโโโโโโ\n"
+ "๐ {pn} <new prefix> -g: ๐๐ก๐๐ง๐ ๐ ๐ญ๐ก๐ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ข๐ง ๐ญ๐ก๐ ๐๐ง๐ญ๐ข๐ซ๐ ๐ฌ๐ฒ๐ฌ๐ญ๐๐ฆ (๐จ๐ง๐ฅ๐ฒ ๐๐จ๐ญ ๐๐๐ฆ๐ข๐ง)\n"
+ "โโโโโโโโโโโโโโโโโโโ\n"
+ "๐ ๐๐ฑ๐๐ฆ๐ฉ๐ฅ๐:\n"
+ "๐น {pn} # -g\n"
+ "โโโโโโโโโโโโโโโโโโโ\n"
+ "๐ ๏ธ {pn} reset: ๐๐๐ฌ๐๐ญ ๐ฒ๐จ๐ฎ๐ซ ๐๐ก๐๐ญ ๐๐จ๐ฑ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ญ๐จ ๐๐๐๐๐ฎ๐ฅ๐ญ\n"
+ "โโโโโโโโโโโโโโโโโโโ"
}
},
langs: {
en: {
reset:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ โ
๐๐จ๐ฎ๐ซ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ก๐๐ฌ ๐๐๐๐ง ๐ซ๐๐ฌ๐๐ญ ๐ญ๐จ ๐๐๐๐๐ฎ๐ฅ๐ญ: %1\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ",
onlyAdmin:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ โ ๏ธ ๐๐ง๐ฅ๐ฒ ๐๐๐ฆ๐ข๐ง ๐๐๐ง ๐๐ก๐๐ง๐ ๐ ๐ญ๐ก๐ ๐ฌ๐ฒ๐ฌ๐ญ๐๐ฆ ๐ฉ๐ซ๐๐๐ข๐ฑ!\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ",
confirmGlobal:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ ๐ ๐๐ฅ๐๐๐ฌ๐ ๐ซ๐๐๐๐ญ ๐ญ๐จ ๐ญ๐ก๐ข๐ฌ ๐ฆ๐๐ฌ๐ฌ๐๐ ๐ ๐ญ๐จ ๐๐จ๐ง๐๐ข๐ซ๐ฆ ๐๐ก๐๐ง๐ ๐ข๐ง๐ ๐ญ๐ก๐ ๐ฌ๐ฒ๐ฌ๐ญ๐๐ฆ ๐ฉ๐ซ๐๐๐ข๐ฑ.\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ",
confirmThisThread:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ ๐ ๐๐ฅ๐๐๐ฌ๐ ๐ซ๐๐๐๐ญ ๐ญ๐จ ๐ญ๐ก๐ข๐ฌ ๐ฆ๐๐ฌ๐ฌ๐๐ ๐ ๐ญ๐จ ๐๐จ๐ง๐๐ข๐ซ๐ฆ ๐๐ก๐๐ง๐ ๐ข๐ง๐ ๐ญ๐ก๐ ๐ฉ๐ซ๐๐๐ข๐ฑ.\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ",
successGlobal:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ โ
๐๐ฒ๐ฌ๐ญ๐๐ฆ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ก๐๐ฌ ๐๐๐๐ง ๐๐ก๐๐ง๐ ๐๐ ๐ญ๐จ: %1\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ",
successThisThread:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ โ
๐๐ก๐๐ญ ๐ ๐ซ๐จ๐ฎ๐ฉ ๐ฉ๐ซ๐๐๐ข๐ฑ ๐ก๐๐ฌ ๐๐๐๐ง ๐๐ก๐๐ง๐ ๐๐ ๐ญ๐จ: %1\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ",
myPrefix:
"| โญโโโโโโโโโโโโโโโโโโโ\n"
+ "| โ ๐ง ๐๐ฒ๐ฌ๐ญ๐๐ฆ ๐๐ซ๐๐๐ข๐ฑ: %1\n"
+ "| โ ๐ ๐๐จ๐ฎ๐ซ ๐๐ซ๐จ๐ฎ๐ฉ ๐๐ซ๐๐๐ข๐ฑ: %2\n"
+ "| โฐโโโโโโโโโโโโโโโโโโโ"
}
},
onStart: async function ({
message,
role,
args,
commandName,
event,
threadsData,
getLang
}) {
const body = (event.body || "").trim().toLowerCase();
if (body === "prefix") return;
if (!args[0]) {
return message.reply(
getLang(
"myPrefix",
global.GoatBot.config.prefix,
utils.getPrefix(event.threadID)
)
);
}
if (args[0].toLowerCase() === "reset") {
await threadsData.set(
event.threadID,
null,
"data.prefix"
);
return message.reply(
getLang(
"reset",
global.GoatBot.config.prefix
)
);
}
const newPrefix = args[0];
const formSet = {
commandName,
author: event.senderID,
newPrefix,
setGlobal: args[1] === "-g"
};
if (formSet.setGlobal && role < 2) {
return message.reply(
getLang("onlyAdmin")
);
}
const confirmMessage = formSet.setGlobal
? getLang("confirmGlobal")
: getLang("confirmThisThread");
return message.reply(
confirmMessage,
(err, info) => {
if (err) return;
formSet.messageID = info.messageID;
global.GoatBot.onReaction.set(
info.messageID,
formSet
);
}
);
},
onChat: async function ({
message,
event,
getLang
}) {
const body = (event.body || "").trim().toLowerCase();
if (body !== "prefix") return;
return message.reply(
getLang(
"myPrefix",
global.GoatBot.config.prefix,
utils.getPrefix(event.threadID)
)
);
},
onReaction: async function ({
message,
threadsData,
event,
Reaction,
getLang
}) {
const {
author,
newPrefix,
setGlobal
} = Reaction;
if (event.userID !== author) return;
if (setGlobal) {
global.GoatBot.config.prefix = newPrefix;
fs.writeFileSync(
global.client.dirConfig,
JSON.stringify(
global.GoatBot.config,
null,
2
)
);
return message.reply(
getLang(
"successGlobal",
newPrefix
)
);
}
await threadsData.set(
event.threadID,
newPrefix,
"data.prefix"
);
return message.reply(
getLang(
"successThisThread",
newPrefix
)
);
}
};