Skip to content
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

Update dashboard cog for d.py 2.0 #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TrustyJAID
Copy link
Contributor

@TrustyJAID TrustyJAID commented Oct 24, 2022

Just making this PR as a way to track all the things I have had to change already to make the dashboard cog work on d.py 2.0. Feel free to ignore the PR or do something different.

Comment on lines -354 to -362
region = getattr(guild.region, "name", guild.region)
parts = region.split("_")
for i, p in enumerate(parts):
if p in ["eu", "us", "vip"]:
parts[i] = p.upper()
else:
parts[i] = p.title()
region = " ".join(parts)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Region is no longer part of the guild object. Maybe replace region with the servers locale?

Comment on lines +16 to +19
@commands.group(name="dashboard")
async def dashboard(self, ctx: commands.Context):
"""Group command for controlling the web dashboard for Red."""
pass
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is because the old method of importing the top level command object caused an unexpected CTX to be required for all commands preventing Red's autohelp from functioning and all commands for that matter. This method maintains the expected behavior of one top level command shared between all files.

Copy link

@RedPrismOwner RedPrismOwner left a comment

Choose a reason for hiding this comment

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

looks great to me

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.

3 participants