Skip to content

Commit

Permalink
Pr/fix/UI b checks (#22)
Browse files Browse the repository at this point in the history
* Fix release helper subcommands (Cog-Creators#6451)

* Fix for UIBs regarding permission fetching

---------

Co-authored-by: Jakub Kuczys <[email protected]>
Co-authored-by: Kowlin <[email protected]>
  • Loading branch information
3 people authored Sep 24, 2024
1 parent 5000507 commit cedec95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion redbot/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,12 @@ async def ignored_channel_or_guild(
if ctx.channel.type is not discord.ChannelType.private:
raise TypeError("Can't check permissions for non-private PartialMessageable.")
is_private = True
perms = ctx.channel.permissions_for(author)
if isinstance(ctx, discord.Interaction):
perms = ctx.app_permissions
# The permissions here are always linked to the interaction author &
# the channel it originated from.
else:
perms = ctx.channel.permissions_for(author)
surpass_ignore = (
is_private
or perms.manage_guild
Expand Down
7 changes: 5 additions & 2 deletions tools/release_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,11 @@ def set_release_stage(stage: ReleaseStage) -> None:
@click.group(invoke_without_command=True)
@click.option("--continue", "abort", flag_value=False, default=None)
@click.option("--abort", "abort", flag_value=True, default=None)
def cli(*, abort: Optional[bool] = None):
@click.pass_context
def cli(ctx: click.Context, *, abort: Optional[bool] = None):
"""Red's release helper, guiding you through the whole process!"""
if ctx.invoked_subcommand is not None:
return
stage = get_release_stage()
if abort is True:
if stage is not ReleaseStage.WELCOME:
Expand Down Expand Up @@ -397,7 +400,7 @@ def cli(*, abort: Optional[bool] = None):
rich.print(Markdown("# Step 8+: Follow the release process documentation"))
rich.print(
"You can continue following the release process documentation from step 8:\n"
"https://red-devguide.readthedocs.io/core-devs/release-process/"
"https://red-devguide.readthedocs.io/core-devs/release-process/#write-announcement"
)
wipe_git_config_values()

Expand Down

0 comments on commit cedec95

Please sign in to comment.