ignore bots option
This commit is contained in:
parent
4c93d96ae9
commit
c54358e86a
2 changed files with 5 additions and 2 deletions
|
|
@ -17,3 +17,4 @@ max_tokens = 8192
|
||||||
[discord]
|
[discord]
|
||||||
token = "DISCORD_TOKEN_HERE"
|
token = "DISCORD_TOKEN_HERE"
|
||||||
owner = "OWNER_ID_HERE"
|
owner = "OWNER_ID_HERE"
|
||||||
|
ignorebots = true
|
||||||
6
index.js
6
index.js
|
|
@ -17,6 +17,7 @@ const client = new Client({
|
||||||
|
|
||||||
const OLLAMA_URL = "http://localhost:11434/api/generate";
|
const OLLAMA_URL = "http://localhost:11434/api/generate";
|
||||||
const OWNER_ID = config.discord.owner;
|
const OWNER_ID = config.discord.owner;
|
||||||
|
const IGNORE_BOTS = config.discord.ignorebots;
|
||||||
|
|
||||||
async function executeEval(code, message) {
|
async function executeEval(code, message) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -140,8 +141,9 @@ client.once(Events.ClientReady, (readyClient) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on(Events.MessageCreate, async (message) => {
|
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 isMentioned = message.mentions.has(client.user);
|
||||||
const isDM = message.channel.type === 1;
|
const isDM = message.channel.type === 1;
|
||||||
const isReply = message.reference !== null;
|
const isReply = message.reference !== null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue