diff --git a/config.example.toml b/config.example.toml index 195dfa9..1e3f517 100644 --- a/config.example.toml +++ b/config.example.toml @@ -17,3 +17,4 @@ max_tokens = 8192 [discord] token = "DISCORD_TOKEN_HERE" owner = "OWNER_ID_HERE" +ignorebots = true \ No newline at end of file diff --git a/index.js b/index.js index c82e3c7..04f43f7 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ const client = new Client({ const OLLAMA_URL = "http://localhost:11434/api/generate"; const OWNER_ID = config.discord.owner; +const IGNORE_BOTS = config.discord.ignorebots; async function executeEval(code, message) { try { @@ -140,8 +141,9 @@ client.once(Events.ClientReady, (readyClient) => { }); client.on(Events.MessageCreate, async (message) => { - if (message.author.bot) return; - + if (IGNORE_BOTS) { + if (message.author.bot) return; + } const isMentioned = message.mentions.has(client.user); const isDM = message.channel.type === 1; const isReply = message.reference !== null;