Imported group/cog from discord.ext.commands at the top

pull/8/head
sgoudham 4 years ago
parent 0a419d0524
commit 4e0535228b

@ -7,8 +7,7 @@ import discord
import mariadb import mariadb
from discord import Embed from discord import Embed
from discord import File from discord import File
from discord.ext import commands from discord.ext.commands import bot_has_permissions, has_permissions, Cog, group
from discord.ext.commands import bot_has_permissions, has_permissions
import db import db
from settings import enso_embedmod_colours, blank_space from settings import enso_embedmod_colours, blank_space
@ -144,19 +143,19 @@ def SendMsgToModMail(self, msg, author):
# Set up the Cog # Set up the Cog
class Modmail(commands.Cog): class Modmail(Cog):
"""Modmail System!""" """Modmail System!"""
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
self.anon = None self.anon = None
@commands.Cog.listener() @Cog.listener()
async def on_ready(self): async def on_ready(self):
"""Printing out that Cog is ready on startup""" """Printing out that Cog is ready on startup"""
print(f"{self.__class__.__name__} Cog has been loaded\n-----") print(f"{self.__class__.__name__} Cog has been loaded\n-----")
@commands.group(invoke_without_command=True, usage="`[argument...]`") @group(invoke_without_command=True, usage="`[argument...]`")
@has_permissions(manage_guild=True) @has_permissions(manage_guild=True)
@bot_has_permissions(administrator=True) @bot_has_permissions(administrator=True)
async def modmail(self, ctx): async def modmail(self, ctx):
@ -376,7 +375,7 @@ class Modmail(commands.Cog):
f"\nPlease do **{ctx.prefix}help** to find out how to set Modmail again!") f"\nPlease do **{ctx.prefix}help** to find out how to set Modmail again!")
# Setting up Listener to listen for reactions within the modmail channel created # Setting up Listener to listen for reactions within the modmail channel created
@commands.Cog.listener() @Cog.listener()
async def on_raw_reaction_add(self, payload): async def on_raw_reaction_add(self, payload):
# Don't count reactions that are made by the bot # Don't count reactions that are made by the bot
if payload.user_id == self.bot.user.id: if payload.user_id == self.bot.user.id:

Loading…
Cancel
Save