Red 3.2 changes and cleanup

This commit is contained in:
aikaterna
2020-01-09 16:57:33 -08:00
parent 5b3fe0218a
commit 7d73d7931a
10 changed files with 18 additions and 56 deletions

View File

@@ -5,16 +5,8 @@ import discord
from redbot.core import commands, checks, Config
BaseCog = getattr(commands, "Cog", object)
listener = getattr(commands.Cog, "listener", None) # Trusty + Sinbad
if listener is None:
def listener(name=None):
return lambda x: x
class AntiPhoneClapper(BaseCog):
class AntiPhoneClapper(commands.Cog):
"""This cog deletes bad GIFs that will crash phone clients."""
def __init__(self, bot):
@@ -73,7 +65,7 @@ class AntiPhoneClapper(BaseCog):
tile_sizes.append(im.tile[0][1][2:])
return any([x[0] > limit[0] or x[1] > limit[1] for x in tile_sizes])
@listener()
@commands.Cog.listener()
async def on_message(self, m):
if not m.attachments:
return