aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/__main__.py4
-rw-r--r--docs/migrating.rst4
2 files changed, 8 insertions, 0 deletions
diff --git a/discord/__main__.py b/discord/__main__.py
index 5f8b0daf..d40d404d 100644
--- a/discord/__main__.py
+++ b/discord/__main__.py
@@ -119,6 +119,10 @@ cog_extras = '''
# checks that apply to every command to the bot
return True
+ async def __global_check_once(self, ctx):
+ # check that apply to every command but is guaranteed to be called only once
+ return True
+
async def __error(self, ctx, error):
# error handling to every command in here
pass
diff --git a/docs/migrating.rst b/docs/migrating.rst
index fbcc074a..7392844e 100644
--- a/docs/migrating.rst
+++ b/docs/migrating.rst
@@ -937,6 +937,10 @@ An example cog with every special method registered is as follows: ::
print('cog global check')
return True
+ def __global_check_once(self, ctx):
+ print('cog global check once')
+ return True
+
async def __local_check(self, ctx):
print('cog local check')
return await ctx.bot.is_owner(ctx.author)