Skip to content

Bump d.py and add bot base #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 2, 2022
Merged

Bump d.py and add bot base #42

merged 12 commits into from
Apr 2, 2022

Conversation

ChrisLovering
Copy link
Member

@ChrisLovering ChrisLovering commented Mar 23, 2022

This bumps d.py up to a more recent commit, that includes the changes to make cog.ext loading async. See here for more reading https://gist.github.com/Rapptz/6706e1c8f23ac27c98cee4dd985c8120.

This also adds a BotBase class, which is intended to be used by all our bots. This base class implements a lot of our "boiler plate" code, such as stats, root aliases and wait_until_guild_available to name a few.

Since the extensions util is only used on bot startup, to load extensions, I have removed it from the documented utils, since that is now abstracted away by BotBase.load_extensions()

ToDo:

  • Update changelog to show breaking change (due to removal of public extensions util)
  • Rebase so original authors get credit for the utils

@netlify
Copy link

netlify bot commented Mar 23, 2022

Deploy Preview for bot-core ready!

Name Link
🔨 Latest commit 7d00aec
🔍 Latest deploy log https://app.netlify.com/sites/bot-core/deploys/62489e931025bd00099d7df3
😎 Deploy Preview https://deploy-preview-42--bot-core.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@MarkKoz MarkKoz self-requested a review March 23, 2022 22:47
ChrisLovering and others added 5 commits March 24, 2022 08:22
This is used by the bots to push stats to statsd in a non-blocking way.

Co-authored-by: Joe Banks <[email protected]>
This commit also modifies the extensions util, since it's now directly used by bot-core.

Co-authored-by: Mark <[email protected]>
Co-authored-by: Hassan Abouelela <[email protected]>
Since *args and **kwargs already allow these to be passed, there is no use in explicitly listing them.

allowed_roles has been left there, to ensure that it is always passed, since it's important to use this to avoid bots being able to ping large roles.
This allows commands like extensions and source to see all of the available commands, rather than just the currently loaded commands.
@ChrisLovering ChrisLovering force-pushed the bump-d.py-and-add-BotBase branch from cad9722 to a904fcb Compare March 24, 2022 08:25
@ChrisLovering
Copy link
Member Author

Force push was to add co-authors

@ChrisLovering ChrisLovering force-pushed the bump-d.py-and-add-BotBase branch 4 times, most recently from 40ef2a1 to 53bc8f6 Compare March 31, 2022 19:26
Doing a naive git log --grep closing_tasks on the bot repo I found these two places it was used:

python-discord/bot@429cc86 - Reddit cog to revoke the access token on unload, which has since been moved to lance (without this feature).
python-discord/bot@f4004d8 - Silence cog, which has been removed since.

Since this list of tasks to close when closing the Discord connection is no longer used, it has been removed from BotBase.
@ChrisLovering ChrisLovering force-pushed the bump-d.py-and-add-BotBase branch from 53bc8f6 to 5a02b3b Compare March 31, 2022 19:53
@ChrisLovering ChrisLovering requested a review from MarkKoz April 1, 2022 13:14
Copy link
Member

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect there is still some nice way to make statsd optional, but we can revisit it later.

@ChrisLovering ChrisLovering merged commit 765284a into main Apr 2, 2022
@ChrisLovering ChrisLovering deleted the bump-d.py-and-add-BotBase branch April 2, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants