Fix on_message to not execute on DMs
This commit is contained in:
parent
24616d14dc
commit
6e21b7bb67
1 changed files with 9 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
|||
from pathlib import Path
|
||||
import pymongo
|
||||
from datetime import datetime, timedelta
|
||||
from discord import Intents, Member, Message
|
||||
from discord import Intents, Member, Message, DMChannel
|
||||
from discord.ext import commands
|
||||
from discord.ext.tasks import loop
|
||||
from discord.utils import find, get
|
||||
|
@ -70,6 +70,7 @@ async def on_member_join(user: Member):
|
|||
|
||||
@jarvis.event
|
||||
async def on_message(message: Message):
|
||||
if not isinstance(message.channel, DMChannel):
|
||||
db = DBManager(get_config().mongo).mongo
|
||||
autoreact = db.jarvis.autoreact.find_one(
|
||||
{"guild": message.guild.id, "channel": message.channel.id}
|
||||
|
|
Loading…
Add table
Reference in a new issue