goat
command
setting
Bot settings
0
views
0
likes
0
installs
raw source
const fs = require("fs");
const path = require("path");
module.exports = {
config: {
name: "setting",
version: "1.0.0",
author: "๐๐๐๐ฎ๐
",
countDown: 5,
role: 2,
shortDescription: "Bot settings",
longDescription: "Control bot settings",
category: "admin",
guide: "{prefix}setting"
},
onStart: async function ({ api, event, args, message }) {
const mainMenu = [
"โญโใ โ๏ธ ๐๐จ๐ญ ๐๐๐ญ๐ญ๐ข๐ง๐ ๐ฌ ใ",
"โ",
"โ โ ๐๐จ๐ญ ๐๐จ๐ง๐๐ข๐ ",
"โ โ ๐๐๐ฆ๐ข๐ง ๐๐๐ง๐๐ ๐",
"โ โ ๐๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ ๐๐๐ง๐๐ ๐",
"โ โ ๐๐จ ๐๐ซ๐๐๐ข๐ฑ",
"โ โ ๐๐๐๐๐ญ ๐๐ง๐ฌ๐๐ง๐",
"โ โ ๐๐ข๐๐ค๐ง๐๐ฆ๐",
"โ โ ๐
๐๐ ๐๐ฉ๐ญ๐ข๐จ๐ง๐ฌ",
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ใ"
].join("\n");
const sent = await message.reply(mainMenu);
global.GoatBot.onReply.set(sent.messageID, {
commandName: "setting",
messageID: sent.messageID,
author: event.senderID,
state: "main"
});
},
onReply: async function ({ api, event, Reply, message }) {
const { author, state } = Reply;
if (event.senderID !== author) return;
const configPath = path.join(process.cwd(), "config.json");
const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
const input = event.body.trim();
const num = parseInt(input);
function saveConfig() {
fs.writeFileSync(
configPath,
JSON.stringify(config, null, 2),
"utf8"
);
}
function status(val) {
return val ? "โ ๐๐" : "โ ๐๐
๐
";
}
async function sendAndListen(text, newState, extra = {}) {
const sent = await message.reply(text);
global.GoatBot.onReply.set(sent.messageID, {
commandName: "setting",
messageID: sent.messageID,
author,
state: newState,
...extra
});
}
if (state === "main") {
if (num === 1) {
const menu = [
"โญโใ โ๏ธ ๐๐จ๐ญ ๐๐จ๐ง๐๐ข๐ ใ",
"โ",
`โ โ ๐๐๐ฆ๐ข๐ง ๐๐ง๐ฅ๐ฒ ${status(config.adminOnly?.enable)}`,
`โ โ ๐๐ฎ๐ญ๐จ ๐๐๐ฌ๐ญ๐๐ซ๐ญ ${status(config.autoRestart?.enable)}`,
`โ โ ๐๐ง๐ญ๐ข ๐๐ง๐๐จ๐ฑ ${status(config.antiInbox?.enable)}`,
`โ โ ๐๐ง๐ฅ๐ฒ ๐๐๐ฆ๐ข๐ง ๐๐จ๐ฑ ${status(config.onlyAdminBox)}`,
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ๐ญ๐จ ๐ญ๐จ๐ ๐ ๐ฅ๐ ใ"
].join("\n");
return await sendAndListen(menu, "botConfig");
}
if (num === 2) {
const menu = [
"โญโใ ๐ ๐๐๐ฆ๐ข๐ง ๐๐๐ง๐๐ ๐ ใ",
"โ",
"โ โ ๐๐๐ ๐๐๐ฆ๐ข๐ง",
"โ โ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐๐ฆ๐ข๐ง",
"โ โ ๐๐ข๐ฌ๐ญ ๐๐๐ฆ๐ข๐ง๐ฌ",
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ใ"
].join("\n");
return await sendAndListen(menu, "adminManage");
}
if (num === 3) {
const menu = [
"โญโใ ๐ก๏ธ ๐๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ ใ",
"โ",
`โ โ ๐๐ก๐ซ๐๐๐ ๐๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ ${status(config.whiteListModeThread?.enable)}`,
"โ โ ๐๐๐ ๐๐ก๐ซ๐๐๐",
"โ โ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐ก๐ซ๐๐๐",
`โ โ ๐๐ฌ๐๐ซ ๐๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ ${status(config.whiteListMode?.enable)}`,
"โ โ ๐๐๐ ๐๐ฌ๐๐ซ",
"โ โ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐ฌ๐๐ซ",
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ใ"
].join("\n");
return await sendAndListen(menu, "whitelist");
}
if (num === 4) {
config.noPrefix = config.noPrefix || {};
config.noPrefix.enable = !config.noPrefix.enable;
saveConfig();
return message.reply(
`โญโใ โฆ ๐๐จ ๐๐ซ๐๐๐ข๐ฑ ใ\nโ\nโ ${status(config.noPrefix.enable)}\nโฐโ`
);
}
if (num === 5) {
const menu = [
"โญโใ ๐ซ ๐๐๐๐๐ญ ๐๐ง๐ฌ๐๐ง๐ ใ",
"โ",
`โ โ ๐๐จ๐ ๐ ๐ฅ๐ ${status(config.reactUnsend?.enable)}`,
`โ โ ๐๐ง๐ฅ๐ฒ ๐๐๐ฆ๐ข๐ง ${status(config.reactUnsend?.onlyAdmin)}`,
"โ โ ๐๐๐ ๐๐ฆ๐จ๐ฃ๐ข",
"โ โ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐ฆ๐จ๐ฃ๐ข",
"โ โ ๐๐ข๐ฌ๐ญ ๐๐ฆ๐จ๐ฃ๐ข๐ฌ",
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ใ"
].join("\n");
return await sendAndListen(menu, "reactUnsend");
}
if (num === 6) {
const current = config.nickNameBot || "Not set";
const menu = [
"โญโใ โ๏ธ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ใ",
"โ",
`โ โฆ ๐๐ฎ๐ซ๐ซ๐๐ง๐ญ: ${current}`,
"โ",
"โ โ ๐๐๐ญ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ใ๐๐ก๐ข๐ฌ ๐๐ซ๐จ๐ฎ๐ฉใ",
"โ โ ๐๐๐ญ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ใ๐๐ฅ๐ฅ ๐๐ซ๐จ๐ฎ๐ฉ๐ฌใ",
"โ โ ๐๐๐ฌ๐๐ญ ๐๐ข๐๐ค๐ง๐๐ฆ๐",
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ใ"
].join("\n");
return await sendAndListen(menu, "nickname");
}
if (num === 7) {
const o = config.optionsFca || {};
const menu = [
"โญโใ ๐ง ๐
๐๐ ๐๐ฉ๐ญ๐ข๐จ๐ง๐ฌ ใ",
"โ",
`โ โ ๐๐ฎ๐ญ๐จ ๐๐ฉ๐๐๐ญ๐ ${status(o.autoUpdate)}`,
`โ โ ๐๐ข๐ฌ๐ญ๐๐ง ๐๐ฏ๐๐ง๐ญ๐ฌ ${status(o.listenEvents)}`,
`โ โ ๐๐๐ฅ๐ ๐๐ข๐ฌ๐ญ๐๐ง ${status(o.selfListen)}`,
`โ โ ๐๐ข๐ฌ๐ญ๐๐ง ๐๐ฒ๐ฉ๐ข๐ง๐ ${status(o.listenTyping)}`,
`โ โ ๐๐ฉ๐๐๐ญ๐ ๐๐ซ๐๐ฌ๐๐ง๐๐ ${status(o.updatePresence)}`,
`โ โ ๐
๐จ๐ซ๐๐ ๐๐จ๐ ๐ข๐ง ${status(o.forceLogin)}`,
`โ โ ๐๐ฎ๐ญ๐จ ๐๐๐ซ๐ค ๐๐๐๐ ${status(o.autoMarkRead)}`,
`โ โ ๐๐ฎ๐ญ๐จ ๐๐๐๐จ๐ง๐ง๐๐๐ญ ${status(o.autoReconnect)}`,
`โ โ ๐๐๐๐ ๐๐ง๐๐๐ฅ๐๐ ${status(config.e2ee?.enable)}`,
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐โ๐ ๐ญ๐จ ๐ญ๐จ๐ ๐ ๐ฅ๐ ใ"
].join("\n");
return await sendAndListen(menu, "fcaOptions");
}
}
if (state === "botConfig") {
if (num === 1) {
config.adminOnly = config.adminOnly || {};
config.adminOnly.enable = !config.adminOnly.enable;
saveConfig();
return message.reply(`โฆ ๐๐๐ฆ๐ข๐ง ๐๐ง๐ฅ๐ฒ โ ${status(config.adminOnly.enable)}`);
}
if (num === 2) {
config.autoRestart = config.autoRestart || {};
config.autoRestart.enable = !config.autoRestart.enable;
saveConfig();
return message.reply(`โฆ ๐๐ฎ๐ญ๐จ ๐๐๐ฌ๐ญ๐๐ซ๐ญ โ ${status(config.autoRestart.enable)}`);
}
if (num === 3) {
config.antiInbox = config.antiInbox || {};
config.antiInbox.enable = !config.antiInbox.enable;
saveConfig();
return message.reply(`โฆ ๐๐ง๐ญ๐ข ๐๐ง๐๐จ๐ฑ โ ${status(config.antiInbox.enable)}`);
}
if (num === 4) {
config.onlyAdminBox = !config.onlyAdminBox;
saveConfig();
return message.reply(`โฆ ๐๐ง๐ฅ๐ฒ ๐๐๐ฆ๐ข๐ง ๐๐จ๐ฑ โ ${status(config.onlyAdminBox)}`);
}
}
if (state === "adminManage") {
if (num === 1) {
return await sendAndListen(
"โญโใ ๐ ๐๐๐ ๐๐๐ฆ๐ข๐ง ใ\nโ\nโ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ฐ๐ข๐ญ๐ก ๐๐๐ ๐จ๐ซ ๐ญ๐๐ ๐ฎ๐ฌ๐๐ซ\nโฐโ",
"adminAdd"
);
}
if (num === 2) {
const admins = config.adminBot || [];
if (!admins.length)
return message.reply("โฐโใ ๐ซ ๐๐จ ๐๐๐ฆ๐ข๐ง๐ฌ ๐๐จ๐ฎ๐ง๐ ใ");
const list = admins
.map((id, i) => `โ ${i + 1}. ${id}`)
.join("\n");
const menu = [
"โญโใ ๐ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐๐ฆ๐ข๐ง ใ",
"โ",
list,
"โ",
"โฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ง๐ฎ๐ฆ๐๐๐ซ ใ"
].join("\n");
return await sendAndListen(menu, "adminRemoveSelect");
}
if (num === 3) {
const admins = config.adminBot || [];
if (!admins.length)
return message.reply("โฐโใ ๐ซ ๐๐จ ๐๐๐ฆ๐ข๐ง๐ฌ ๐๐จ๐ฎ๐ง๐ ใ");
return message.reply(
`โญโใ ๐ ๐๐๐ฆ๐ข๐ง๐ฌ ใ\nโ\nโ ${admins.join("\nโ ")}\nโฐโ`
);
}
}
if (state === "adminAdd") {
let uid = input;
if (event.mentions && Object.keys(event.mentions).length > 0)
uid = Object.keys(event.mentions)[0];
if (!uid || isNaN(uid))
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐๐๐ ใ");
config.adminBot = config.adminBot || [];
if (config.adminBot.includes(uid))
return message.reply("โฐโใ ๐ซ ๐๐ฅ๐ซ๐๐๐๐ฒ ๐๐ง ๐๐๐ฆ๐ข๐ง ใ");
config.adminBot.push(uid);
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐๐๐๐ ๐๐๐ฆ๐ข๐ง: ${uid} ใ`);
}
if (state === "adminRemoveSelect") {
const admins = config.adminBot || [];
const idx = num - 1;
if (isNaN(num) || !admins[idx])
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ฌ๐๐ฅ๐๐๐ญ๐ข๐จ๐ง ใ");
const removed = admins.splice(idx, 1)[0];
config.adminBot = admins;
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐๐ฆ๐จ๐ฏ๐๐: ${removed} ใ`);
}
if (state === "whitelist") {
if (num === 1) {
config.whiteListModeThread = config.whiteListModeThread || {};
config.whiteListModeThread.enable =
!config.whiteListModeThread.enable;
saveConfig();
return message.reply(
`โฆ ๐๐ก๐ซ๐๐๐ ๐๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ โ ${status(config.whiteListModeThread.enable)}`
);
}
if (num === 2) {
return await sendAndListen(
"โญโใ ๐ก๏ธ ๐๐๐ ๐๐ก๐ซ๐๐๐ ใ\nโ\nโ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ฐ๐ข๐ญ๐ก ๐๐ก๐ซ๐๐๐ ๐๐\nโฐโ",
"threadAdd"
);
}
if (num === 3) {
const threads =
config.whiteListModeThread?.whiteListThreadIds || [];
if (!threads.length)
return message.reply("โฐโใ ๐ซ ๐๐จ ๐ญ๐ก๐ซ๐๐๐๐ฌ ๐๐จ๐ฎ๐ง๐ ใ");
const list = threads
.map((id, i) => `โ ${i + 1}. ${id}`)
.join("\n");
return await sendAndListen(
`โญโใ ๐ก๏ธ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐ก๐ซ๐๐๐ ใ\nโ\n${list}\nโ\nโฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ง๐ฎ๐ฆ๐๐๐ซ ใ`,
"threadRemoveSelect"
);
}
if (num === 4) {
config.whiteListMode = config.whiteListMode || {};
config.whiteListMode.enable = !config.whiteListMode.enable;
saveConfig();
return message.reply(
`โฆ ๐๐ฌ๐๐ซ ๐๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ โ ${status(config.whiteListMode.enable)}`
);
}
if (num === 5) {
return await sendAndListen(
"โญโใ ๐ก๏ธ ๐๐๐ ๐๐ฌ๐๐ซ ใ\nโ\nโ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ฐ๐ข๐ญ๐ก ๐๐๐ ๐จ๐ซ ๐ญ๐๐ ๐ฎ๐ฌ๐๐ซ\nโฐโ",
"userAdd"
);
}
if (num === 6) {
const users = config.whiteListMode?.whiteListIds || [];
if (!users.length)
return message.reply("โฐโใ ๐ซ ๐๐จ ๐ฎ๐ฌ๐๐ซ๐ฌ ๐๐จ๐ฎ๐ง๐ ใ");
const list = users
.map((id, i) => `โ ${i + 1}. ${id}`)
.join("\n");
return await sendAndListen(
`โญโใ ๐ก๏ธ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐ฌ๐๐ซ ใ\nโ\n${list}\nโ\nโฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ง๐ฎ๐ฆ๐๐๐ซ ใ`,
"userRemoveSelect"
);
}
}
if (state === "threadAdd") {
const tid = input;
if (!tid || isNaN(tid))
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐๐ก๐ซ๐๐๐ ๐๐ ใ");
config.whiteListModeThread =
config.whiteListModeThread || {};
config.whiteListModeThread.whiteListThreadIds =
config.whiteListModeThread.whiteListThreadIds || [];
if (
config.whiteListModeThread.whiteListThreadIds.includes(tid)
)
return message.reply("โฐโใ ๐ซ ๐๐ฅ๐ซ๐๐๐๐ฒ ๐ข๐ง ๐ฐ๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ ใ");
config.whiteListModeThread.whiteListThreadIds.push(tid);
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐ก๐ซ๐๐๐ ๐๐๐๐๐: ${tid} ใ`);
}
if (state === "threadRemoveSelect") {
const threads =
config.whiteListModeThread?.whiteListThreadIds || [];
const idx = num - 1;
if (isNaN(num) || !threads[idx])
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ฌ๐๐ฅ๐๐๐ญ๐ข๐จ๐ง ใ");
const removed = threads.splice(idx, 1)[0];
config.whiteListModeThread.whiteListThreadIds = threads;
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐๐ฆ๐จ๐ฏ๐๐: ${removed} ใ`);
}
if (state === "userAdd") {
let uid = input;
if (event.mentions && Object.keys(event.mentions).length > 0)
uid = Object.keys(event.mentions)[0];
if (!uid || isNaN(uid))
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐๐๐ ใ");
config.whiteListMode = config.whiteListMode || {};
config.whiteListMode.whiteListIds =
config.whiteListMode.whiteListIds || [];
if (config.whiteListMode.whiteListIds.includes(uid))
return message.reply("โฐโใ ๐ซ ๐๐ฅ๐ซ๐๐๐๐ฒ ๐ข๐ง ๐ฐ๐ก๐ข๐ญ๐๐ฅ๐ข๐ฌ๐ญ ใ");
config.whiteListMode.whiteListIds.push(uid);
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐ฌ๐๐ซ ๐๐๐๐๐: ${uid} ใ`);
}
if (state === "userRemoveSelect") {
const users = config.whiteListMode?.whiteListIds || [];
const idx = num - 1;
if (isNaN(num) || !users[idx])
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ฌ๐๐ฅ๐๐๐ญ๐ข๐จ๐ง ใ");
const removed = users.splice(idx, 1)[0];
config.whiteListMode.whiteListIds = users;
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐๐ฆ๐จ๐ฏ๐๐: ${removed} ใ`);
}
if (state === "reactUnsend") {
if (num === 1) {
config.reactUnsend = config.reactUnsend || {};
config.reactUnsend.enable = !config.reactUnsend.enable;
saveConfig();
return message.reply(
`โฆ ๐๐๐๐๐ญ ๐๐ง๐ฌ๐๐ง๐ โ ${status(config.reactUnsend.enable)}`
);
}
if (num === 2) {
config.reactUnsend = config.reactUnsend || {};
config.reactUnsend.onlyAdmin =
!config.reactUnsend.onlyAdmin;
saveConfig();
return message.reply(
`โฆ ๐๐ง๐ฅ๐ฒ ๐๐๐ฆ๐ข๐ง โ ${status(config.reactUnsend.onlyAdmin)}`
);
}
if (num === 3) {
return await sendAndListen(
"โญโใ ๐ซ ๐๐๐ ๐๐ฆ๐จ๐ฃ๐ข ใ\nโ\nโ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ฐ๐ข๐ญ๐ก ๐๐ฆ๐จ๐ฃ๐ข\nโฐโ",
"emojiAdd"
);
}
if (num === 4) {
const emojis = config.reactUnsend?.emojis || [];
if (!emojis.length)
return message.reply("โฐโใ ๐ซ ๐๐จ ๐๐ฆ๐จ๐ฃ๐ข๐ฌ ๐๐จ๐ฎ๐ง๐ ใ");
const list = emojis
.map((e, i) => `โ ${i + 1}. ${e}`)
.join("\n");
return await sendAndListen(
`โญโใ ๐ซ ๐๐๐ฆ๐จ๐ฏ๐ ๐๐ฆ๐จ๐ฃ๐ข ใ\nโ\n${list}\nโ\nโฐโใ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ง๐ฎ๐ฆ๐๐๐ซ ใ`,
"emojiRemoveSelect"
);
}
if (num === 5) {
const emojis = config.reactUnsend?.emojis || [];
if (!emojis.length)
return message.reply("โฐโใ ๐ซ ๐๐จ ๐๐ฆ๐จ๐ฃ๐ข๐ฌ ใ");
return message.reply(
`โญโใ ๐ซ ๐๐ฆ๐จ๐ฃ๐ข๐ฌ ใ\nโ\nโ ${emojis.join(" ")}\nโฐโ`
);
}
}
if (state === "emojiAdd") {
const emoji = input.trim();
if (!emoji)
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐๐ฆ๐จ๐ฃ๐ข ใ");
config.reactUnsend = config.reactUnsend || {};
config.reactUnsend.emojis =
config.reactUnsend.emojis || [];
if (config.reactUnsend.emojis.includes(emoji))
return message.reply("โฐโใ ๐ซ ๐๐ฅ๐ซ๐๐๐๐ฒ ๐๐๐๐๐ ใ");
config.reactUnsend.emojis.push(emoji);
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐๐๐๐: ${emoji} ใ`);
}
if (state === "emojiRemoveSelect") {
const emojis = config.reactUnsend?.emojis || [];
const idx = num - 1;
if (isNaN(num) || !emojis[idx])
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ฌ๐๐ฅ๐๐๐ญ๐ข๐จ๐ง ใ");
const removed = emojis.splice(idx, 1)[0];
config.reactUnsend.emojis = emojis;
saveConfig();
return message.reply(`โฐโใ โฆ ๐๐๐ฆ๐จ๐ฏ๐๐: ${removed} ใ`);
}
if (state === "nickname") {
if (num === 1) {
return await sendAndListen(
"โญโใ โ๏ธ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ใ\nโ\nโ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ฐ๐ข๐ญ๐ก ๐ง๐๐ฐ ๐ง๐ข๐๐ค๐ง๐๐ฆ๐\nโฐโ",
"nicknameSet"
);
}
if (num === 2) {
return await sendAndListen(
"โญโใ โ๏ธ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ใ๐๐ฅ๐ฅใใ\nโ\nโ โบ ๐๐๐ฉ๐ฅ๐ฒ ๐ฐ๐ข๐ญ๐ก ๐ง๐๐ฐ ๐ง๐ข๐๐ค๐ง๐๐ฆ๐\nโฐโ",
"nicknameSetAll"
);
}
if (num === 3) {
config.nickNameBot = "";
saveConfig();
try {
await api.changeNickname(
"",
event.threadID,
api.getCurrentUserID()
);
} catch (e) {}
return message.reply("โฐโใ โฆ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ๐ซ๐๐ฌ๐๐ญ ใ");
}
}
if (state === "nicknameSet") {
const nickname = input;
if (!nickname)
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ง๐ข๐๐ค๐ง๐๐ฆ๐ ใ");
config.nickNameBot = nickname;
saveConfig();
try {
await api.changeNickname(
nickname,
event.threadID,
api.getCurrentUserID()
);
} catch (e) {}
return message.reply(
`โฐโใ โฆ ๐๐ข๐๐ค๐ง๐๐ฆ๐: ${nickname} ใ`
);
}
if (state === "nicknameSetAll") {
const nickname = input;
if (!nickname)
return message.reply("โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ง๐ข๐๐ค๐ง๐๐ฆ๐ ใ");
config.nickNameBot = nickname;
saveConfig();
const threads = await api.getThreadList(
100,
null,
["INBOX"]
);
let success = 0;
for (const thread of threads) {
if (!thread.isGroup) continue;
try {
await api.changeNickname(
nickname,
thread.threadID,
api.getCurrentUserID()
);
success++;
} catch (e) {}
}
return message.reply(
`โญโใ โฆ ๐๐ข๐๐ค๐ง๐๐ฆ๐ ๐๐ฉ๐๐๐ญ๐๐ ใ\nโ\nโ โบ ${nickname}\nโ โบ ๐๐ซ๐จ๐ฎ๐ฉ๐ฌ: ${success}\nโฐโ`
);
}
if (state === "fcaOptions") {
const keys = [
"autoUpdate",
"listenEvents",
"selfListen",
"listenTyping",
"updatePresence",
"forceLogin",
"autoMarkRead",
"autoReconnect"
];
if (num === 9) {
config.e2ee = config.e2ee || {};
config.e2ee.enable = !config.e2ee.enable;
saveConfig();
return message.reply(
`โญโใ ๐ ๐๐๐๐ ใ\nโ\nโ ${status(config.e2ee.enable)}\nโ\nโฐโใ โบ ๐๐๐ฌ๐ญ๐๐ซ๐ญ ๐๐จ๐ญ ๐๐จ๐ซ ๐๐ก๐๐ง๐ ๐ ใ`
);
}
const key = keys[num - 1];
if (!key)
return message.reply(
"โฐโใ ๐ซ ๐๐ง๐ฏ๐๐ฅ๐ข๐ ๐ฌ๐๐ฅ๐๐๐ญ๐ข๐จ๐ง ใ"
);
config.optionsFca = config.optionsFca || {};
config.optionsFca[key] = !config.optionsFca[key];
saveConfig();
if (key !== "autoUpdate" && key !== "forceLogin") {
api.setOptions({
[key]: config.optionsFca[key]
});
}
return message.reply(
`โฐโใ โฆ ๐
๐๐ ${key} โ ${status(config.optionsFca[key])} ใ`
);
}
}
};