Red-DiscordBot/redbot/core/global_checks.py
Michael H e38c08ab12
fix uptime for uptime of less than a second (#3009)
* fix uptime for uptime of less than a second

* changelog

* More conclusive fix
2019-09-28 15:35:26 -04:00

22 lines
613 B
Python

"""The checks in this module run on every command."""
from . import commands
def init_global_checks(bot):
@bot.check_once
def actually_up(ctx):
"""
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):
return await ctx.bot.allowed_by_whitelist_blacklist(ctx.author)
@bot.check_once
def bots(ctx):
"""Check the user is not another bot."""
return not ctx.author.bot