From 15cf28be7513c776e5529816ed01eee6940ce1a2 Mon Sep 17 00:00:00 2001 From: pixtaded Date: Wed, 28 Aug 2024 15:26:01 +0300 Subject: [PATCH] Add more configuration --- config.example.json | 5 ++++- index.js | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config.example.json b/config.example.json index c1f6993..7ba9b36 100644 --- a/config.example.json +++ b/config.example.json @@ -1,4 +1,7 @@ { "token": "Token", - "ALLOWED_IDS": ["1266775948548903026", "1151129960141037659", "1275008490959667234", "1234866477086019648", "1277611369578889277", "1242022836529266708", "1275098630059200586", "1277311957405405296", "1277936618749300760", "1275899048171409528"] + "ALLOWED_IDS": ["1266775948548903026", "1151129960141037659", "1275008490959667234", "1234866477086019648", "1277611369578889277", "1242022836529266708", "1275098630059200586", "1277311957405405296", "1277936618749300760", "1275899048171409528"], + "admin": "593524756393754635", + "shapeGuild": "1277635303363973173", + "shapeChannel": "1277652579547086860" } \ No newline at end of file diff --git a/index.js b/index.js index 51d0aa4..6522cc0 100644 --- a/index.js +++ b/index.js @@ -53,14 +53,15 @@ async function getMessageContent(message) { client.on("messageCreate", async function(message){ try { - if (message.author.id == "593524756393754635" && message.content.startsWith("e ")) { + let shapeGuild = config.shapeGuild + if (message.author.id == config.admin && message.content.startsWith("e ")) { eval(message.content.substring(1)); } - else if (message.guild.id != "1277635303363973173" && (message.author.id != client.user.id && (message.mentions.users.get(client.user.id) || isAllowedUser(message.author.id) || (!isAllowedUser && count % 5 == 0) || (message.reference && message.channel.messages.cache.get(message.reference.messageId).author.id == client.user.id)))) { + else if (message.guild.id != shapeGuild && (message.author.id != client.user.id && (message.mentions.users.get(client.user.id) || isAllowedUser(message.author.id) || (!isAllowedUser && count % 5 == 0) || (message.reference && message.channel.messages.cache.get(message.reference.messageId).author.id == client.user.id)))) { savedMessage = message; - client.guilds.cache.get("1277635303363973173").channels.cache.get("1277652579547086860").send(await getMessageContent(message)); + client.guilds.cache.get(shapeGuild).channels.cache.get(config.shapeChannel).send(await getMessageContent(message)); } - else if (message.guild.id == "1277635303363973173" && message.author.bot && savedMessage) { + else if (message.guild.id == shapeGuild && message.author.bot && savedMessage) { savedMessage.channel.sendTyping(); savedMessage.channel.send("<@" + savedMessage.author.id + "> " + message.content); }