[commands] Add __global_check_once to list of cog functions.

This commit is contained in:
Rapptz 2017-06-20 23:55:17 -04:00
parent 717f11d635
commit c23ef9e8a4
2 changed files with 8 additions and 0 deletions

View File

@ -119,6 +119,10 @@ cog_extras = '''
# checks that apply to every command to the bot # checks that apply to every command to the bot
return True 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): async def __error(self, ctx, error):
# error handling to every command in here # error handling to every command in here
pass pass

View File

@ -937,6 +937,10 @@ An example cog with every special method registered is as follows: ::
print('cog global check') print('cog global check')
return True return True
def __global_check_once(self, ctx):
print('cog global check once')
return True
async def __local_check(self, ctx): async def __local_check(self, ctx):
print('cog local check') print('cog local check')
return await ctx.bot.is_owner(ctx.author) return await ctx.bot.is_owner(ctx.author)