Add blacklist.

This commit is contained in:
pixtaded 2024-09-02 14:41:41 +03:00
parent b05d765497
commit ef0633d2e5
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,7 @@
{ {
"token": "Token", "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"],
"DISALLOWED_IDS": ["1275098630059200586"],
"admin": "593524756393754635", "admin": "593524756393754635",
"shapeGuild": "1277635303363973173", "shapeGuild": "1277635303363973173",
"shapeChannel": "1277652579547086860", "shapeChannel": "1277652579547086860",

View File

@ -19,6 +19,12 @@ function isAllowedUser(id) {
return false; return false;
} }
function isDisallowedUser(id) {
const DISALLOWED_IDS = config.DISALLOWED_IDS;
if (DISALLOWED_IDS.find(string => string == id) || !DISALLOWED_IDS.length) return true;
return false;
}
async function getMessageContent(message) { async function getMessageContent(message) {
if (message.attachments.size > 0) { if (message.attachments.size > 0) {
try { try {
@ -60,13 +66,15 @@ function filterPrompt(string) {
} }
async function sendToAI(message) { async function sendToAI(message) {
if (message.author.id == client.user.id) return; if (message.author.id == client.user.id && isDisallowedUser(message.author.id)) return;
if (message.author.id == config.admin && message.content.startsWith("e ")) { if (message.author.id == config.admin && message.content.startsWith("e ")) {
eval(message.content.substring(1)); eval(message.content.substring(1));
return; return;
} }
if (message.content.length >= 1800) return;
savedMessage = message; savedMessage = message;
client.guilds.cache.get(shapeGuild).channels.cache.get(config.shapeChannel).send(await getMessageContent(message)); client.guilds.cache.get(shapeGuild).channels.cache.get(config.shapeChannel).send(await getMessageContent(message));
} }