diff --git a/koans/twitch/component.py b/koans/twitch/component.py index 5a3dc8a..44441b7 100644 --- a/koans/twitch/component.py +++ b/koans/twitch/component.py @@ -129,19 +129,19 @@ class KoanComponent(cmds.Component): community = await self.bot.profiles.fetch_community(ctx.broadcaster) cid = community.communityid + koan = None if label is not None: koan = await self.koans.get_koan_label(cid, label) - if koan: - await ctx.reply(koan.message) - else: + if not koan: await ctx.reply(f"Koan #{label} does not exist!") else: koans = await self.koan.get_community_koans(communityid=cid) if koans: koan = random.choice(koans) - formatted = f"Koan #{koan.koanlabel}: {koan.content}" - parts = [formatted[i: i:500] for i in range(0, len(formatted), 500)] - for part in parts: - await ctx.reply(part) else: await ctx.reply("This channel doesn't have any koans!") + if koan: + formatted = f"Koan #{koan.koanlabel}: {koan.content}" + parts = [formatted[i: i:500] for i in range(0, len(formatted), 500)] + for part in parts: + await ctx.reply(part)