question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This 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 prepends bot.cogs to the name given

And there’s maybe more stuff I’m forgetting.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
SebastiaanZcommented, Nov 15, 2019

Yes, we should. I think it would also be a good idea to override the close method to close the aiohttp session correctly.

(this is in reference to #244)

0reactions
scraglycommented, Nov 15, 2019

Define it in bot/bot.py. Sure it might feel a little odd but it’s the most appropriate place for it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found