Don't snipe steam codes, fixes #78

(bot commands can be sniped)
This commit is contained in:
Stijn De Clercq 2021-06-30 21:55:17 +02:00
parent ecb7de062b
commit 09cad58f43
6 changed files with 68 additions and 5 deletions

View file

@ -1,5 +1,5 @@
from data import constants
from data.snipe import Snipe, Action
from data.snipe import Snipe, Action, should_snipe
import datetime
import discord
from discord.ext import commands
@ -276,13 +276,13 @@ class Events(commands.Cog):
if not checks.freeGamesCheck(after):
return await self.failedChecksCog.freeGames(after)
if before.guild is not None and not before.author.bot:
if should_snipe(before):
self.client.snipe[before.channel.id] = Snipe(before.author.id, before.channel.id, before.guild.id, Action.Edit,
before.content, after.content)
@commands.Cog.listener()
async def on_message_delete(self, message: discord.Message):
if message.guild is not None and not message.author.bot:
if should_snipe(message):
self.client.snipe[message.channel.id] = Snipe(message.author.id, message.channel.id, message.guild.id,
Action.Remove, message.content)