diff --git a/redbot/cogs/audio/core/commands/audioset.py b/redbot/cogs/audio/core/commands/audioset.py index f3dfb0837d6..85d1b31248e 100644 --- a/redbot/cogs/audio/core/commands/audioset.py +++ b/redbot/cogs/audio/core/commands/audioset.py @@ -1472,7 +1472,7 @@ async def command_audioset_persist_queue(self, ctx: commands.Context): ) @command_audioset.command(name="restart") - @commands.is_owner() + # @commands.is_owner() async def command_audioset_restart(self, ctx: commands.Context): """Restarts the lavalink connection.""" async with ctx.typing(): diff --git a/redbot/cogs/customcom/customcom.py b/redbot/cogs/customcom/customcom.py index 7fefb36b713..8245d04e4a8 100644 --- a/redbot/cogs/customcom/customcom.py +++ b/redbot/cogs/customcom/customcom.py @@ -646,7 +646,7 @@ async def on_message_without_command(self, message): if isinstance(message.channel, discord.PartialMessageable): return - if len(message.content) < 2 or is_private or not user_allowed or message.author.bot: + if len(message.content) < 2 or is_private or not user_allowed: return if await self.bot.cog_disabled_in_guild(self, message.guild): diff --git a/redbot/core/bot.py b/redbot/core/bot.py index 89f711ef009..b919923630a 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -822,8 +822,8 @@ async def message_eligible_as_command(self, message: discord.Message) -> bool: channel = message.channel guild = message.guild - if message.author.bot: - return False + # if message.author.bot: + # return False # We do not consider messages with PartialMessageable channel as eligible. # See `process_commands()` for our handling of it. @@ -1621,38 +1621,35 @@ async def process_commands(self, message: discord.Message, /): messages, without the overhead of additional get_context calls per cog. """ - if not message.author.bot: - ctx = await self.get_context(message) - - # The licenseinfo command must always be available, even in a slash only bot. - # To get around not having the message content intent, a mention prefix - # will always work for it. - if not ctx.valid: - for m in (f"<@{self.user.id}> ", f"<@!{self.user.id}> "): - if message.content.startswith(m): - ctx.view.undo() - ctx.view.skip_string(m) - invoker = ctx.view.get_word() - command = self.all_commands.get(invoker, None) - if isinstance(command, commands.commands._AlwaysAvailableMixin): - ctx.command = command - ctx.prefix = m - break + ctx = await self.get_context(message) + + # The licenseinfo command must always be available, even in a slash only bot. + # To get around not having the message content intent, a mention prefix + # will always work for it. + if not ctx.valid: + for m in (f"<@{self.user.id}> ", f"<@!{self.user.id}> "): + if message.content.startswith(m): + ctx.view.undo() + ctx.view.skip_string(m) + invoker = ctx.view.get_word() + command = self.all_commands.get(invoker, None) + if isinstance(command, commands.commands._AlwaysAvailableMixin): + ctx.command = command + ctx.prefix = m + break - if ( + if ( ctx.invoked_with and isinstance(message.channel, discord.PartialMessageable) and message.channel.type is not discord.ChannelType.private - ): - log.warning( - "Discarded a command message (ID: %s) with PartialMessageable channel: %r", - message.id, - message.channel, - ) - else: - await self.invoke(ctx) + ): + log.warning( + "Discarded a command message (ID: %s) with PartialMessageable channel: %r", + message.id, + message.channel, + ) else: - ctx = None + await self.invoke(ctx) if ctx is None or ctx.valid is False: self.dispatch("message_without_command", message) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 42aab5221bb..9c88745d9b3 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -2408,7 +2408,7 @@ async def _shutdown(self, ctx: commands.Context, silently: bool = False): await ctx.bot.shutdown() @commands.command(name="restart") - @commands.is_owner() + # @checks.is_owner() async def _restart(self, ctx: commands.Context, silently: bool = False): """Attempts to restart [botname].