discord-modmail / modmail

A Modmail bot for Discord. Allowing safe moderator conversations with server members one server at a time.
https://discord-modmail.readthedocs.io/
MIT License
15 stars 8 forks source link

[Plugins] Not inheriting from PluginCog causes an error which is not about the problem at all #62

Open onerandomusername opened 3 years ago

onerandomusername commented 3 years ago

Is there an existing issue for this?

Current Behavior

Error which has nothing to do with the root cause, and therefore, easy solution.

image

Expected Behavior

image

Steps To Reproduce

Minimally reproductive code:

import logging

from discord.ext import commands
from discord.ext.commands import Context

from modmail.plugin_helpers import ModmailBot, ModmailLogger

log: ModmailLogger = logging.getLogger(__name__)

class Planet(commands.Cog):
    """This is a planet."""

    def __init__(self, bot: ModmailBot):
        self.bot = bot

    @commands.command()
    async def world(self, ctx: Context):
        log.debug("The alien {0} has requested to know what planet they are on.".format(ctx.author))
        await ctx.send("earth")

def setup(bot: ModmailBot):
    bot.add_cog(Planet(bot))

Select your hosting method

local hosting

Anything else?

No response