-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: master
Are you sure you want to change the base?
Conversation
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) | ||
|
There was a problem hiding this comment.
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?
@commands.group(name="dashboard") | ||
async def dashboard(self, ctx: commands.Context): | ||
"""Group command for controlling the web dashboard for Red.""" | ||
pass |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
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.