Subclass Bot
See original GitHub issueThis allows us to do some backend QoL stuff:
- Override
add_cog()
so that it logs the loading of cogs - IDEs will recognise additional attributes, such as the API client
- Override
load_extensions()
so that it automatically prependsbot.cogs
to the name given
And there’s maybe more stuff I’m forgetting.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
DnD 5e - Fighter Subclass Breakdown
Character optimization guide for the DnD 5e Fighter's subclasses.
Read more >discord.py - Subclassing commands.Bot vs instantiating it
Subclassing allows you to extend, expand, and even diminish, or degrade, the existing functions and coroutines. Perhaps to add extra validation ...
Read more >While using bot subclass (instead of client), how can I get ...
I'm trying to make a simple Discord birthday bot to practice. TL;DR My bot won't recognize input from the user (aka the "name")...
Read more >commands.Bot as subclass is not sending context #5153
Summary I try to create a subclass of commands.Bot and add there methods to the command. But when I run the bot and...
Read more >API Reference - discord.py - Read the Docs
Client you can do with this bot. This class also subclasses GroupMixin to provide the functionality to manage commands. Unlike discord.Client , this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we should. I think it would also be a good idea to override the
close
method to close theaiohttp
session correctly.(this is in reference to #244)
Define it in
bot/bot.py
. Sure it might feel a little odd but it’s the most appropriate place for it.