From e4a3d205f70f150327e0802e2d7632078f2d85b7 Mon Sep 17 00:00:00 2001 From: aikaterna Date: Fri, 7 Apr 2017 21:57:28 -0700 Subject: [PATCH] Cleanup chatterbot.py --- chatterbot/chatterbot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chatterbot/chatterbot.py b/chatterbot/chatterbot.py index 79be495..a8ca8b9 100644 --- a/chatterbot/chatterbot.py +++ b/chatterbot/chatterbot.py @@ -1,4 +1,3 @@ -import discord from discord.ext import commands try: from chatterbot import ChatBot @@ -6,12 +5,13 @@ try: except: chatbotInstalled = False -class Chatterbot: + +class ChatterBot: """Chatter with the bot.""" def __init__(self, bot): self.bot = bot - + @commands.command(pass_context=True) async def chatterbot(self, ctx, message): """Talk with the bot via ChatterBot.""" @@ -19,9 +19,10 @@ class Chatterbot: chatbot.train("chatterbot.corpus.english") await self.bot.say(chatbot.get_response(message)) + def setup(bot): if chatbotInstalled is False: raise RuntimeError("Install ChatterBot:\n" "[p]debug bot.pip_install('ChatterBot')\n" "Then [p]load chatterbot") - bot.add_cog(Chatterbot(bot)) + bot.add_cog(ChatterBot(bot))