ignore bots option

This commit is contained in:
Eri Ishihara 2026-02-17 18:12:15 +01:00
parent 4c93d96ae9
commit c54358e86a
2 changed files with 5 additions and 2 deletions

View file

@ -17,3 +17,4 @@ max_tokens = 8192
[discord]
token = "DISCORD_TOKEN_HERE"
owner = "OWNER_ID_HERE"
ignorebots = true

View file

@ -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;