Allow pre_invoke to be used by 3rd party cogs safely. (#3369)

* Okay, so there's a lot in this diff

* fix docstrings

* meh

* fix misleading var name

* meh...

* useful typehints

* Apply suggestions from code review

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* dep warn in locations suitable

* Fix this...

* Apply suggestions from code review

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Michael H
2020-01-15 20:44:21 -05:00
committed by GitHub
parent 27e6f677e8
commit 60dc54b081
2 changed files with 74 additions and 9 deletions

View File

@@ -13,14 +13,6 @@ def init_global_checks(bot):
"""
return ctx.channel.permissions_for(ctx.me).send_messages
@bot.check_once
def actually_up(ctx) -> bool:
"""
Uptime is set during the initial startup process.
If this hasn't been set, we should assume the bot isn't ready yet.
"""
return ctx.bot.uptime is not None
@bot.check_once
async def whiteblacklist_checks(ctx) -> bool:
return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)