Ignore on_message(_edit) from @jarvis
This commit is contained in:
parent
a2704475b0
commit
0519dbd91f
2 changed files with 46 additions and 39 deletions
|
@ -34,6 +34,9 @@ jarvis_self = Process()
|
|||
__version__ = "0.9.9"
|
||||
|
||||
|
||||
db = DBManager(get_config().mongo).mongo
|
||||
|
||||
|
||||
@jarvis.event
|
||||
async def on_ready():
|
||||
global restart_ctx
|
||||
|
@ -84,8 +87,10 @@ 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
|
||||
if (
|
||||
not isinstance(message.channel, DMChannel)
|
||||
and not message.author.id == jarvis.client.id
|
||||
):
|
||||
autoreact = db.jarvis.autoreact.find_one(
|
||||
{"guild": message.guild.id, "channel": message.channel.id}
|
||||
)
|
||||
|
|
|
@ -2,12 +2,13 @@ import asyncio
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
import discord
|
||||
import jarvis
|
||||
import pymongo
|
||||
from discord import DMChannel
|
||||
from discord.ext import commands
|
||||
from discord.utils import find
|
||||
from discord_slash import SlashContext
|
||||
|
||||
import jarvis
|
||||
from jarvis.config import get_config
|
||||
from jarvis.utils import build_embed
|
||||
from jarvis.utils.db import DBManager
|
||||
|
@ -356,6 +357,7 @@ class ModlogCog(commands.Cog):
|
|||
async def on_message_edit(
|
||||
self, before: discord.Message, after: discord.Message
|
||||
):
|
||||
if before.author != self.bot.client.id:
|
||||
modlog = self.db.jarvis.settings.find_one(
|
||||
{"guild": after.guild.id, "setting": "modlog"}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue