Closed JamesZoft closed 3 years ago
Did you forget to call super()
inside __init__
?
I couldn't reproduce this with or without the option so I'm closing this.
Hi, I’m not sure, sorry. It’s a problem I’m having whilst trying to run the latest version of modmail https://github.com/chamburr/modmail and send the ‘=help’ command - modmail depends on discord.py@master. If I revert to before the commit I’ve specified the problem goes away.
Whoever wrote that bot decided that writing all the attributes by hand was a good idea. So whenever the library updates, the code used in the bot will break which is what happened here. Unfortunately this is not an issue with the library but with the bot itself. You're better off opening an issue there -- and hopefully get them to avoid all the duplication of library code since it's fragile.
I see, I’ll pass it on, thanks!
Developer of the mentioned bot here. Since my bot does not use the built-in gateway, and neither does it use the built-in state cache, patching the methods is the best option for me.
Summary
When requiring discord.py/master and trying to use the get_context, it errors because strip_after_prefix doesn't exist
Reproduction Steps
Use self.bot.get_context(message)
Minimal Reproducible Code
Expected Results
It would return without an error
Actual Results
[Cluster 1] Traceback (most recent call last): [Cluster 1] File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 343, in _run_event [Cluster 1] await coro(*args, **kwargs) [Cluster 1] File "/modmail/modmail/cogs/events.py", line 129, in on_message [Cluster 1] ctx = await self.bot.get_context(message) [Cluster 1] File "/usr/local/lib/python3.8/dist-packages/discord/ext/commands/bot.py", line 915, in get_context [Cluster 1] if self.strip_after_prefix: [Cluster 1] AttributeError: 'ModMail' object has no attribute 'strip_after_prefix'
Intents
32767
System Information
Checklist
I have searched the open issues for duplicates. I have shown the entire traceback, if possible. I have removed my token from display, if visible.