discord-modmail / discord-modmail/modmail

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

Open
#62 0 comments 0 reactions 1 assignee View on GitHub

@bast0006 is already working on this.

Since Aug 23, 2021.

  • #69 by @onerandomusername — open
a: addon system l: beginner p: normal t: bug
Dominant language
Python
Stars
14
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Is there an existing issue for this?
  • I have searched the existing issues and there is no existing issue.
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.