From bd26e7d5afa99cad6c9906fc24bc6bc9c485bb1a Mon Sep 17 00:00:00 2001 From: Kowlin <10947836+Kowlin@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:16:03 +0100 Subject: [PATCH 1/2] Fix permissions fetching for User Installable Bots (#6457) Co-authored-by: Jakub Kuczys --- redbot/core/bot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/redbot/core/bot.py b/redbot/core/bot.py index 6cba99d8891..c63b2bb9584 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -886,7 +886,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.Message): + perms = ctx.channel.permissions_for(author) + else: + # `permissions` attribute will use permissions from the interaction when possible, + # or `ctx.channel.permissions_for(author)` for non-interaction contexts. + perms = ctx.permissions surpass_ignore = ( is_private or perms.manage_guild From 3aac07a4d789d27b71062e5964c95dd6372b2a09 Mon Sep 17 00:00:00 2001 From: Glas <48269777+DJTOMATO@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:22:02 -0300 Subject: [PATCH 2/2] Explain how to remove URL restrictions in the play error message (#6348) Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com> Co-authored-by: Jakub Kuczys --- redbot/cogs/audio/core/commands/player.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redbot/cogs/audio/core/commands/player.py b/redbot/cogs/audio/core/commands/player.py index a925c7a4632..3e3b5273ed7 100644 --- a/redbot/cogs/audio/core/commands/player.py +++ b/redbot/cogs/audio/core/commands/player.py @@ -50,7 +50,9 @@ async def command_play(self, ctx: commands.Context, *, query: str): return await self.send_embed_msg( ctx, title=_("Unable To Play Tracks"), - description=_("That URL is not allowed."), + description=_( + "That URL is not allowed.\n\nThe bot owner can remove this restriction by using ``{prefix}audioset restrict``." + ).format(prefix=ctx.clean_prefix), ) elif not await self.is_query_allowed(self.config, ctx, f"{query}", query_obj=query): return await self.send_embed_msg(