mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
* [Core] Add `Red.message_eligible_as_command` - This is a small utility function which makes it easy for cog creators to treat non-command messages as commands correctly. - This also modifies `Red.ignored_channel_or_guild`'s signature to explicitly add support for passing a message object (the only needed attributes are entirely shared with context) * Update redbot/core/bot.py Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * address review * Rename * remove webhhok check, the issue wasn't possible under normal operation * Ah yes, ctx.bot in a method of the bot... Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
9 lines
281 B
Python
9 lines
281 B
Python
"""The checks in this module run on every command."""
|
|
from . import commands
|
|
|
|
|
|
def init_global_checks(bot):
|
|
@bot.check_once
|
|
async def check_message_is_eligible_as_command(ctx: commands.Context) -> bool:
|
|
return await ctx.bot.message_eligible_as_command(ctx.message)
|