def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ bot.add_cog(BaseCog(bot)) print("BaseCog is ready.")
def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ bot.add_cog(Verification(bot)) print("Verification is ready.")
def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ bot.add_cog(Announce(bot)) print("Announce is ready.")
def setup(bot: KoalaBot) -> None: """ Loads this cog into the selected bot :param bot: The client of the KoalaBot """ bot.add_cog(IntroCog(bot)) print("IntroCog is ready.")
def setup(bot: KoalaBot) -> None: """ Loads this cog into the selected bot :param bot: The client of the KoalaBot """ bot.add_cog(TextFilter(bot))
def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ bot.add_cog(ColourRole(bot)) print("ColourRole is ready.")
def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ bot.add_cog(Info(bot)) print("Info is ready")
def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ if GMAIL_EMAIL is None or GMAIL_PASSWORD is None: print("Verification not started. API keys not found in environment.") KoalaBot.database_manager.insert_extension("Verify", 0, False, False) else: bot.add_cog(Verification(bot)) print("Verification is ready.")
async def predicate(ctx): cog = ctx.command.cog if KoalaBot.is_dm_channel(ctx): return False return ctx.author.id in cog.vote_manager.configuring_votes.keys( ) and cog.vote_manager.configuring_votes[ ctx.author.id].guild == ctx.guild.id
def colour_is_enabled(ctx): """ A command used to check if the guild has enabled twitch alert e.g. @commands.check(KoalaBot.is_admin) :param ctx: The context of the message :return: True if admin or test, False otherwise """ try: result = KoalaBot.check_guild_has_ext(ctx, "ColourRole") except PermissionError: result = False return result or (str(ctx.author) == KoalaBot.TEST_USER and KoalaBot.is_dpytest)
def vote_is_enabled(ctx): """ A command used to check if the guild has enabled verify e.g. @commands.check(vote_is_enabled) :param ctx: The context of the message :return: True if enabled or test, False otherwise """ try: result = KoalaBot.check_guild_has_ext(ctx, "Vote") except PermissionError: result = False return result or (str(ctx.author) == KoalaBot.TEST_USER and KoalaBot.is_dpytest)
def test_test_user_is_owner(test_ctx): assert KoalaBot.is_owner(test_ctx)
def setup(bot: KoalaBot) -> None: """ Load this cog to the KoalaBot. :param bot: the bot client for KoalaBot """ bot.add_cog(LastCtxCog(bot))
def test_not_admin_is_admin(test_ctx): test_ctx.author = FakeAuthor(all_permissions=False) KoalaBot.is_dpytest = False assert not KoalaBot.is_admin(test_ctx) KoalaBot.is_dpytest = True
def test_admin_is_admin(test_ctx): test_ctx.author = FakeAuthor(name="TestUser#0002", all_permissions=True) assert KoalaBot.is_admin(test_ctx)
def test_invalid_test_user_is_admin(test_ctx): test_ctx.author = FakeAuthor(id=int(KoalaBot.BOT_OWNER) + 2) KoalaBot.is_dpytest = False assert not KoalaBot.is_admin(test_ctx) KoalaBot.is_dpytest = True
def test_test_user_is_admin(test_ctx): assert KoalaBot.is_admin(test_ctx)
def test_owner_is_owner(test_ctx): test_ctx.author = FakeAuthor(id=int(KoalaBot.BOT_OWNER)) assert KoalaBot.is_owner(test_ctx)
async def predicate(ctx): cog = ctx.command.cog if KoalaBot.is_dm_channel(ctx): return False return ctx.author.id in map(lambda x: x[0], cog.vote_manager.vote_lookup.keys())
def test_invalid_test_user_is_admin(test_ctx): test_ctx.author = FakeAuthor(name="TestUser#0002") assert not KoalaBot.is_admin(test_ctx)