From e5a16c908e60b22c571e18b653d1032393ecd3b9 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Wed, 2 May 2018 16:34:19 -0400 Subject: [PATCH 01/50] pep8 --- chatter/chatter.py | 49 +++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/chatter/chatter.py b/chatter/chatter.py index f6999fe..3678324 100644 --- a/chatter/chatter.py +++ b/chatter/chatter.py @@ -1,16 +1,13 @@ import asyncio -from typing import List, Union +from datetime import datetime, timedelta import discord from discord.ext import commands - from redbot.core import Config -from redbot.core.bot import Red from .source import ChatBot from .source.trainers import ListTrainer -from datetime import datetime,timedelta class Chatter: """ @@ -24,17 +21,17 @@ class Chatter: default_guild = { "whitelist": None, "days": 1 - } - + } + self.chatbot = ChatBot("ChatterBot") self.chatbot.set_trainer(ListTrainer) self.config.register_global(**default_global) self.config.register_guild(**default_guild) - + self.loop = asyncio.get_event_loop() - - async def _get_conversation(self, ctx, in_channel: discord.TextChannel=None): + + async def _get_conversation(self, ctx, in_channel: discord.TextChannel = None): """ Compiles all conversation in the Guild this bot can get it's hands on Currently takes a stupid long time @@ -42,9 +39,8 @@ class Chatter: """ out = [] after = datetime.today() - timedelta(days=(await self.config.guild(ctx.guild).days())) - - for channel in ctx.guild.text_channels: + for channel in ctx.guild.text_channels: if in_channel: channel = in_channel await ctx.send("Gathering {}".format(channel.mention)) @@ -52,7 +48,7 @@ class Chatter: try: async for message in channel.history(limit=None, reverse=True, after=after): if user == message.author: - out[-1] += "\n"+message.clean_content + out[-1] += "\n" + message.clean_content else: user = message.author out.append(message.clean_content) @@ -60,12 +56,12 @@ class Chatter: pass except discord.HTTPException: pass - + if in_channel: break - + return out - + def _train(self, data): try: self.chatbot.train(data) @@ -80,45 +76,46 @@ class Chatter: """ if ctx.invoked_subcommand is None: await ctx.send_help() + @chatter.command() async def age(self, ctx: commands.Context, days: int): """ Sets the number of days to look back Will train on 1 day otherwise """ - + await self.config.guild(ctx.guild).days.set(days) await ctx.send("Success") - + @chatter.command() async def train(self, ctx: commands.Context, channel: discord.TextChannel = None): """ Trains the bot based on language in this guild """ - + conversation = await self._get_conversation(ctx, channel) - + if not conversation: await ctx.send("Failed to gather training data") return - + await ctx.send("Gather successful! Training begins now\n(**This will take a long time, be patient**)") - embed=discord.Embed(title="Loading") + embed = discord.Embed(title="Loading") embed.set_image(url="http://www.loop.universaleverything.com/animations/1295.gif") temp_message = await ctx.send(embed=embed) future = await self.loop.run_in_executor(None, self._train, conversation) - + try: await temp_message.delete() except: pass - + if future: await ctx.send("Training successful!") else: await ctx.send("Error occurred :(") - - async def on_message(self, message): + + async def on_message(self, message): """ Credit to https://github.com/Twentysix26/26-Cogs/blob/master/cleverbot/cleverbot.py for on_message recognition of @bot @@ -137,5 +134,3 @@ class Chatter: if not response: response = ":thinking:" await channel.send(response) - - From 87365a5afcfad49ae262e0ab27f6ffb114a06470 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 09:50:14 -0400 Subject: [PATCH 02/50] Discord update --- fight/fight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fight/fight.py b/fight/fight.py index ff115e1..931c7c9 100644 --- a/fight/fight.py +++ b/fight/fight.py @@ -1142,7 +1142,7 @@ class Fight: #**************** Attempt 2, borrow from Squid******* - async def on_raw_reaction_add(self, emoji: discord.PartialReactionEmoji, + async def on_raw_reaction_add(self, emoji: discord.PartialEmoji, message_id: int, channel_id: int, user_id: int): """ Event handler for long term reaction watching. From 6697ed3b92c6587814669b7825d93a2c0e05e367 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 10:43:38 -0400 Subject: [PATCH 03/50] No compiled files --- .../source/__pycache__/__init__.cpython-36.pyc | Bin 431 -> 0 bytes .../source/__pycache__/adapters.cpython-36.pyc | Bin 2088 -> 0 bytes .../__pycache__/chatterbot.cpython-36.pyc | Bin 4567 -> 0 bytes .../__pycache__/comparisons.cpython-36.pyc | Bin 10029 -> 0 bytes .../source/__pycache__/constants.cpython-36.pyc | Bin 279 -> 0 bytes .../__pycache__/conversation.cpython-36.pyc | Bin 7190 -> 0 bytes .../__pycache__/preprocessors.cpython-36.pyc | Bin 1352 -> 0 bytes .../response_selection.cpython-36.pyc | Bin 2260 -> 0 bytes .../source/__pycache__/trainers.cpython-36.pyc | Bin 12169 -> 0 bytes chatter/source/__pycache__/utils.cpython-36.pyc | Bin 4635 -> 0 bytes .../ext/__pycache__/__init__.cpython-36.pyc | Bin 128 -> 0 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 143 -> 0 bytes .../__pycache__/models.cpython-36.pyc | Bin 3947 -> 0 bytes .../__pycache__/types.cpython-36.pyc | Bin 807 -> 0 bytes .../input/__pycache__/__init__.cpython-36.pyc | Bin 565 -> 0 bytes .../input/__pycache__/gitter.cpython-36.pyc | Bin 5019 -> 0 bytes .../input/__pycache__/hipchat.cpython-36.pyc | Bin 2838 -> 0 bytes .../__pycache__/input_adapter.cpython-36.pyc | Bin 1291 -> 0 bytes .../input/__pycache__/mailgun.cpython-36.pyc | Bin 1965 -> 0 bytes .../input/__pycache__/microsoft.cpython-36.pyc | Bin 3569 -> 0 bytes .../input/__pycache__/terminal.cpython-36.pyc | Bin 820 -> 0 bytes .../variable_input_type_adapter.cpython-36.pyc | Bin 2104 -> 0 bytes .../logic/__pycache__/__init__.cpython-36.pyc | Bin 704 -> 0 bytes .../logic/__pycache__/best_match.cpython-36.pyc | Bin 2159 -> 0 bytes .../__pycache__/logic_adapter.cpython-36.pyc | Bin 4037 -> 0 bytes .../__pycache__/low_confidence.cpython-36.pyc | Bin 1964 -> 0 bytes .../mathematical_evaluation.cpython-36.pyc | Bin 2138 -> 0 bytes .../__pycache__/multi_adapter.cpython-36.pyc | Bin 4798 -> 0 bytes .../no_knowledge_adapter.cpython-36.pyc | Bin 1062 -> 0 bytes .../specific_response.cpython-36.pyc | Bin 1416 -> 0 bytes .../__pycache__/time_adapter.cpython-36.pyc | Bin 3068 -> 0 bytes .../output/__pycache__/__init__.cpython-36.pyc | Bin 480 -> 0 bytes .../output/__pycache__/gitter.cpython-36.pyc | Bin 2915 -> 0 bytes .../output/__pycache__/hipchat.cpython-36.pyc | Bin 2191 -> 0 bytes .../output/__pycache__/mailgun.cpython-36.pyc | Bin 1621 -> 0 bytes .../output/__pycache__/microsoft.cpython-36.pyc | Bin 3347 -> 0 bytes .../__pycache__/output_adapter.cpython-36.pyc | Bin 974 -> 0 bytes .../output/__pycache__/terminal.cpython-36.pyc | Bin 757 -> 0 bytes .../storage/__pycache__/__init__.cpython-36.pyc | Bin 417 -> 0 bytes .../__pycache__/django_storage.cpython-36.pyc | Bin 6425 -> 0 bytes .../storage/__pycache__/mongodb.cpython-36.pyc | Bin 9350 -> 0 bytes .../__pycache__/sql_storage.cpython-36.pyc | Bin 9766 -> 0 bytes .../__pycache__/storage_adapter.cpython-36.pyc | Bin 6517 -> 0 bytes 43 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 chatter/source/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/adapters.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/chatterbot.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/comparisons.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/constants.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/conversation.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/preprocessors.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/response_selection.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/trainers.cpython-36.pyc delete mode 100644 chatter/source/__pycache__/utils.cpython-36.pyc delete mode 100644 chatter/source/ext/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/ext/sqlalchemy_app/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/ext/sqlalchemy_app/__pycache__/models.cpython-36.pyc delete mode 100644 chatter/source/ext/sqlalchemy_app/__pycache__/types.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/gitter.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/hipchat.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/input_adapter.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/mailgun.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/microsoft.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/terminal.cpython-36.pyc delete mode 100644 chatter/source/input/__pycache__/variable_input_type_adapter.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/best_match.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/logic_adapter.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/low_confidence.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/mathematical_evaluation.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/multi_adapter.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/no_knowledge_adapter.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/specific_response.cpython-36.pyc delete mode 100644 chatter/source/logic/__pycache__/time_adapter.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/gitter.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/hipchat.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/mailgun.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/microsoft.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/output_adapter.cpython-36.pyc delete mode 100644 chatter/source/output/__pycache__/terminal.cpython-36.pyc delete mode 100644 chatter/source/storage/__pycache__/__init__.cpython-36.pyc delete mode 100644 chatter/source/storage/__pycache__/django_storage.cpython-36.pyc delete mode 100644 chatter/source/storage/__pycache__/mongodb.cpython-36.pyc delete mode 100644 chatter/source/storage/__pycache__/sql_storage.cpython-36.pyc delete mode 100644 chatter/source/storage/__pycache__/storage_adapter.cpython-36.pyc diff --git a/chatter/source/__pycache__/__init__.cpython-36.pyc b/chatter/source/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index b9aa8f4ffa1604d2d368000b99247712e72ab30a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 431 zcmYjMyH3L}6t&azm9}Ew2Rt?sO_0ifDufD^U}FI>SdlC@wh~K;T{#X4nfMTXfQ|3T z%ET`);iRp=md`!D_xhgWayY*x_|&v((Csus`7=%8?nRw*JxNMQ&GcCXFoDp#z` S_;t@tD5e%%ICWgu?cOhc6Mzf= diff --git a/chatter/source/__pycache__/adapters.cpython-36.pyc b/chatter/source/__pycache__/adapters.cpython-36.pyc deleted file mode 100644 index b4f47b3f2f7afdee9621da93f9358e126da1e40b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2088 zcmb7F-HzKt6!zFo>}0!i=@zLHNQ?l9rl=99T&*g!+f}J5AU9oc5v^o7p0kM;$2K#Q z?Zyfc((YsQ1-Roqcmv;Z#Vc^dIpc}5TSZVJ&9Bd#pYMF<qEQ&XUv2{(qpfA zKlX($I@iv)gBrUcK#c)(QDcDTQ1tNJgAmU>(MJnAb#Nr&QiH5c`W$~pTrEnFNfs-` z&kD)oEaPz_!p$wHVc&=zl(CHGJS(PCkO%m(T-rxiQL z&^0@EwRgp?+?5mg=FYuhxbFxD-Sb9ux6xk*$t>2BLJzvNHw9e>bf4zax`(IljSqDg zMR`1jD3TspkYsP**1m%5tnU8wI+j!QnHuyf`yL$LQv>LN}SPc_1}57ZxK*25mWpVO1z-5@Lk) zvIHZ5-w(Le*}60uFbkdRq2p$6Kx?KucvtTz(2=!vmqIjg2i5)>kQ?7`(U%f)NDn^2 z=@xwh;R*kmA%Q!hO9U1!Vii^o*DCG$10c)9sL(IxWd?J|HHha@7P9)I4dE!~aG5}< zQ{*EeIRP%?RDs~HXOI)Hv8D9fXydb3@f^XL0Dew4iZ`I0EXy>(Vpw7xQiZ4rJZh6W z1ey{k-~zG&i-+TPxGW(-&&YbKkHlIZt>qMb!J3cPbtE%t0aVWBJtC$*6e7X+rWquK7sjx?+GCW_G zN0qhAdFQHWUtm|lT3X~S+nfIl(_fHK5)#1vCN^vv4Sa*1d>=iQ#Adlq(*_!|Gdock-biY2)b~v@r-X!l*xS2j f?gyTvG}YZ=a*kDR?zSnZ!>0{pzM;$+5{BMCYoQ4{ diff --git a/chatter/source/__pycache__/chatterbot.cpython-36.pyc b/chatter/source/__pycache__/chatterbot.cpython-36.pyc deleted file mode 100644 index 4b790ba13c4f8ff75d1698cc7572153a9fadb551..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4567 zcmZu!OLN=S6~>DoNRbrvuq{90Aa2@(PR*uu+sSA=P8_>#GI7+_@+2)r9t7sSl0kz2 zeF4f63(a(fUUZd7w_SAI{)z7TC+?z~uF_x7@v7gsARtmUIJmsebI}tK{_n@xzblIK6;UHn$kHU*Nc_T zZkCAPfZt)k7)#jO`aB*_veR+qBhCGC>;>#@-fl*1aG>7hHIYAG>D*kCW9a^ zHP2!etKq-K)>xf6FLlpm4c5d=ovpAI{vFn49sD#~0LX^?%I zWYZ6tE}lE?Ac+sTNP{d);vjNa7(~f|JHRgYNs{%|u7Lqo=;`1kxWB-g{u^R59S{TV z6I0i6J=c5#E%>~plt$p0C#w%)USL2o%*Q;?`-PO)IGYz*nS%-Dl z>Pszm?g6bCQC!Wnp*HLe*XSg>Omt^3s-r7;?Vk2{^Q58H*Yid}Q`esV?`z14GaET* zfIDs2TIjc{K4G!O)|LFt1HxzX$jzIex^=RGQ=96}bNLE!qHEvj&v!tXPHnJFa7(hB z%Ud)3q@B01f2ES@yxMh6@qa-fzoll*XBUT;vdf@n;I=Dj?gHCVqqo%PBD*v*zSD&S zy{j{goCo%DWk--X!jjj%oJ3jpAUOyJb90tf9E`ZElc~T`1$Xot@Z~I4`TntQ$)se91LI` znFzv|i|N~E?wil2{YS+H*;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Sto5L$rmo1G>f zA*Z-W3PKq*<|e@;J}G}=dZhfw>}k6OotF1>C;&M8NZ&0<3;dHL=Ksl~z={q!XrT=A=lZ;FcG; zBuT};OPrze*dj6vI2L~88MyJ3v-RH-Bjh?}CqJg!4{^&EF8_im?ofp#H|TkjZa<>i zG0S{yahYl1Jt;%kI49{;EbH)w>i;}FIk=_8JaI*|(*g-plooLm2L!@1N{jArhys2X z11Q)!aTjl_i}?0*mv9U?aEJ0Xb+=UljdEY|dsJrv0i?BgNRbx!2ofg_1QgQpd;1+R zq~A8Ag(3DZPET#z`smi}ckkTV{H(qC!JYRuKKS_d&BpT4fQeR<>TarU$&YBbKgO+9 zAcb+WudP;zg$3pOVJj^w$eUK@fNH8|0n1Z3P01n-D9Xg-D=29NWU`RUs^}HuvTAw- z@k^~{>1Xw`#)@eda3R07s-H&Ns(wKquRT@j)*Gc`qZp3{<-8V&-CR7SjDUO}4gZCU zfA?UYwG0kss21#^gV5I6++k;P;pbP9j;XTa+v+WZ4l-te!I2|kxW2!|zgyswOiqq* zh{OY?r~0$sCA6oB-PUrJ2%J@%n#Ho2wV{+)YqggJNpmU2B{RXUJ(ji)c+58%8I7| diff --git a/chatter/source/__pycache__/constants.cpython-36.pyc b/chatter/source/__pycache__/constants.cpython-36.pyc deleted file mode 100644 index e1dd4ef4684db4a09b967d20ab5194a973f64252..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 279 zcmXr!<>lJYFej>#k%8ec0}=r8861GPSOiFJjJ*A+?dmbiaP&$Wu3llIrso#3_wy(hJ(1);jSu2v z@P0kO@4-%-1?_H>Wx-CA1=&s{1rK^6-${8E>}7b#Q#CS4WiRT+0}=3eYfDHh6lCR+ zK`-T^n=Px6Z3c?yM|Zl`ab+Hwq1CZ)5H`4_1`+}HM7}4JAm0%|H_q}P-3sz(I}5f_ ziH{)8?4cK@IZal$G>Gn*=x+ValEmH5UR_^#_(1gf5AUW2H-GWk!}d;;=R%hE%`|`5 zPLsz%W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AJj-#UXW=2_w{iKMhp7szAsHfRo ztA~mjCF9)bvYvh9GOfhQ&vF-)v>LoE)x$jUyd3p&T^-8_Yk5QG*v{S?x+*>Jj!FH! zQ9VpY9ai|1pXZ3&s84%H&fv^Yr~)7diVdS&#UlAl(9^8Tb=*+KMAu#(cjcRSRX(($b*7s3{UBrIqxdn2xhlCtn(ZjY7jM^i5Jt(BNOV zN~!@3W^F*Nc|)~91ua<4gcCmBd(zsK{l=^!*Yg+Jl-!~3;NKK8r59AZZZ+M)(j`)`_G diff --git a/chatter/source/__pycache__/preprocessors.cpython-36.pyc b/chatter/source/__pycache__/preprocessors.cpython-36.pyc deleted file mode 100644 index 954526ba6ea33d347a3a74e163407d5e8def4234..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1352 zcmZ`(&2HO95Z*tEv|_oAQxph#=)#8pYGYq=36daa;lOD6;}&&L6ovqT;;v$I{wa1v8tU{6VCnKK@ct%FGI+r8hZ;ig@!fofJ%n2KO_AqL|I8HGN%}I!0(*ZNywyg*0HJQI9dSv zY1CohIGVMAnFCdyNo~0_dDck5Pi?=x+r9`=Cp3*$Bcjww`~7WG8w z`;h0D2j!Am6xvfZjPyNldefU7Z+xo$&>Jtz(rm%b4Q?-{zRp7k86QVcLbvcHPDnzw zi2ev7cR2SD1Lr@%=9cr|@tk%PdV9sah2EXAz%J{^6nZ|qlfZn>j~C2BEaC;8Gn;g` znO=va?V$X+6b9%nawYC`H;C}X@xklY@1^1Lm$o>|N|;iZOFu4mWoWMcQ53Vbsw*kfpJ39ROm5VZy7lrE;Z)>IHENbm!@9A*E-MaxMGMgTc0o2B$rTVp+y85x{w?s_Yhc0X}Hq%q2wVKQdqVapQT-UV_S|a zC%LN^3fB+N56~~rw|*YK_UWLXpfBx=e5>82NBaSyMPscc&1f{g86WQLMZf*{%k+CM(BOb!jpiC3c1OlOH^Wn1XH zE`;6EutW*A5S37ghAppio#hovSRogA$`YQ`VC*2efb)|lDf)wL1l@&x1ikqN1g9&9 zdn;FyCDqP3U3s0ibh&#@DS30ZqhFHmKVJErzw|l+vq2Yh?h9Yt>HL+`1uOUEo$pA8 zzWd2@N=U?@P3lA?C3sP{I&L(auLMUX>@l-{?hS6Gg@kK5Wo4q%46Y@qhFwfcSRh!6 zzMn{aFzD5%wfMK%i)s_{EjB#e61Y89iqH4<%q3|p+OvVY~vGN z=#vY$T5|U2ctEOJZ0s2A|D*ZhFKA=G9|0SSyjt`-3!%S-u~2;&$5m2_IPSf?n#+D4 zrsB01aVpzNk4OFWw_@4v*(G=p)0-xMpxSPo-q`pysObYV4<>gk1-)+!{7Te&;NPEz zN0ZqzQP#7sru~%XoTGjsYgRs-GKKtFEA%O=q4}j!ocQ((>ah2bm?ioqvz&FNe9*70|L~$$=B~V z^-m4`2Jm^VfNmRI$W-%s9XE!k{1@hD4>o`gy6jfWMzbHY=7-ffbq^FK#yC(IJLRJY zP+*zsgSk||W$zZE8oO!-Cn6NPD3G{8T!+!Xy)kO>`2^lK$Pn3$Xh^R)>K2SGGHB8w z^AP@+PXsBUpi-g%8tp;BbUSzHb9Wi&(H1@qjsYJpIeN$OIkJT}sW`;=pApAzz$V*= z@_uE795|qT0EIkH#o7H0Ny%F}*WZCHipF6dC}Uq?xwwiZbrUD{L5#gEl+5z0c)Dfk zsL^SGdIY;0B#`W0qnAj%j~byg$1#^_91o_kG#S_wPH&-Vpf$XPpOuogh4>s1G?Zdd J3qK0?{|4lgqILiP diff --git a/chatter/source/__pycache__/trainers.cpython-36.pyc b/chatter/source/__pycache__/trainers.cpython-36.pyc deleted file mode 100644 index 2c3633dcd30189f03765dae0886a1e46e23a94a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12169 zcmbtaOOV{gdB$sIFpnM1E|<%fEWwIiBa5>VNxf)U7DByC+C*RHB~sIQk6@1$tfpZlJEZ;z|5|e zOk9~MG|-LiMnC@l`(J%-VWIZ-zx~th`>!d=zbkV;1J7^a3V$DotGMbw>B_s>RX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<8R%?dmuaDS`^cHJ7SRjU5qS{4s@d&denwYeQmIeCtAU)KyT$x%aNq>qPUwJQ%z)9 zk{_1IpzM{W05PHNapAwR2e!F5jezi&B(8i zK1DB6j7g9Z)Tnqy$RvP01=%Qs0aDD~vh-N6>#4d;IK||*S*O#vZjt;DooWeAU}5e? zgJvoISf&!wF5_-rAPE8KfD2(y4*|P*F6o;2@2~?|j8H{Q6TV;Qj_C;J{q5VrHIsYW z(5)?sXd#mi7t7sh8~*u5T3HOVgI*P9~N5(Mqnxvy| zI4|OB!#cOWnB_}oRn*%$P1GiT!;{~~`yy9T24B=70=PvGRhJ_NRfd{bbG!ha45jj} z5_*Ekzs<6iBcF_lGB*Ix=?DP=s&Z5O6Ly$B6S)x}M>DvY;wMc~0`RcU#yIVuaWy=% zE|^%sNsaJAYTm$F@Yp75!M6w|Hmy1*dm$;;8cpyC7ClCpE07uC$y-pAVe z84{%)cG;69hcHWA()U)8H+t=6fKktilv}YGDi;I`%Gd6;+U-8<9QFWv=FG|o(B>C%`kgCC3s$m_DDX{Ih zZY{;7cj;?x?X{Mi(|hMFE3+mv#sX*TT=yb$C_|xoks2oh@wKDmWixMoSlJYFei!u2p)q77+?f49Dul(1xTbY1T$zd`mJOr0tq9CU%Jj#F(IkB1u<^< z6}n-@G07Q;B_*jvF~#|%Maii#sTCzL@$s2?nI-Y@dIgoYIBatBQ%ZAE?Lfv912F>t DF?${P diff --git a/chatter/source/ext/sqlalchemy_app/__pycache__/__init__.cpython-36.pyc b/chatter/source/ext/sqlalchemy_app/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 2faf4fc963ccf25e6957e68aad72eb4bdfc8813e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 143 zcmXr!<>lJYFei!u2p)q77+?f49Dul(1xTbY1T$zd`mJOr0tq9CUpCHGF(IkB1u<^< z6}n-@G07Q;B_*jvF~#|%Maii#sTCzL#f3SEImsERxs~yW1qCtj@tJvHTytG*dkux=6xDAX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XRwzX_9-3v9Mx^uOOFRo)>as-^XhT! zLSq(ib`G<3LSytB=&PrOH(3P_j^Va=n_Xctl2OZ@XAL-PQyFx;t#D*wi}xJZJ@dms z3K-7KN&{LmjonP@>EOjoYP<7Q#Q zb@IL3zeust^rPrm#}t&N$qLe*z-L@mMnDCCMYpr?KiiHVK+xBKGzZC-vW7&1q(CmJ zG6ve&%PCU<3w^3H7ck))_QW*Rhr7$jeo~_r-y0M^)tFjB)<*rQ!(e%qBTQe(2 zDP|^aW);Pw{9RC;bqsO^X5kT5h~<`8g|JB0x2D2(eCO(ooo1Rpqu+GGZ+SZ(PM@6? z<=Y=o@iuPzSJD)UHeQ~-()APCm?n%@RJ?=D;s>a@o${^5R_6IW?Yb@Ywz2RR6qQ|5 z?B$UsXujKd3r}{D(+Wc6>l{)jk0Fl`6zy<}V&{4yVnKXoCb6y@%)L9c6Yjh|^`Vm| ztCWGtDkO!cA+J$+njn~wr3~LtsZiP5Pcb3pX||jwj8r+QwCLMI+A+_30&MX;+D3`n x6fE!1kVL#qC&*^ZUaXm zR33vD;KuX#2&a7oPK?vC6fx0^M;`n0_s!&VI1Imk{+j&22>nER7C?RuZk|C9NZb&~6dKyMx{*7p^bkuCoBhyvQxT|IqV7+-6 zKA(V_F$94HDbOul(0?XQ*wPKr$7_5Qh+uW z?Lt-2thI9YW@ObpjhO^e^8SwDOW+*Yg)IFkSR=tLpK&9%Og*rM=A-GI=eg=Nc7F0a z?m22&;|`Znn_N{auja~yxydVId6h{hTkQ^@tI*jvaDkD<-1U~cXr$|loEI{)`T!8W zA$7^{|^o_bX`EZ(M3vR8{sZkB6O684B&2_^=0~(NkbbHe{NJf7ZjXO2k|92g1cV-XE U_egs{H+Z$Bb>^pH{Dl$y4OXYpX#fBK diff --git a/chatter/source/input/__pycache__/__init__.cpython-36.pyc b/chatter/source/input/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 360dbeb75312529fb444a290e94c9d0785503107..0000000000000000000000000000000000000000 GIT binary patch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)RktU9-!_r2EzJwGYn{N6i zx^&T{`cayG7nky2W{>6iNN&s?$u(;(m6)HBU}wdln6$h~x;+_$3K{6LeGz-ZSR5iJ zP4OHj@pU!CIZP>!hN`$&q}w{v$NnrS-KQ``7i6_T72(G;th`Mtp=%SDqGQ^K4$b&K z2+BOwoTX4b?r0q0czw!G9Qz9M26DMBEzQ* zPf{9Ma9)Q1X<`uvn)vtem^UhR=yCJK@`&0MQH0rf)P)RCxsDLs27$0U1aAO>B%eTi@UMd+4Bw^UNE-4McDJWElk0yH=%CaC Z9M7OAY2Uc-6{vndZq_nHM`8R~{{y(ly~h9m diff --git a/chatter/source/input/__pycache__/hipchat.cpython-36.pyc b/chatter/source/input/__pycache__/hipchat.cpython-36.pyc deleted file mode 100644 index 9ce7312ccceaec0f249caf4785ee1a9c04a7c46f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2838 zcmai0TaOz_6|U-wyX|Su%+6-XX1O)6fQ*!}AkqqjTW;(wLW+QlK(Yq4nyzxDownPl zDraUK`^k~^iTwqDc;y%HU+R^o`3tOKiaH;bK-6wUAj=8maP1V=mN{l=CazXe7Uy%@^jr$mdYF@|wx+ z6O$V`l`~V2p>6Y9K|g>X*@z1^@&q6GU$8M3p73AAqd){Ae8ong=sU;ws3W?fhnYz1 zi3I=g7c5{Sa&zBCpO^E8XSrEUdnwxeSz3}iY2Nsg8oW#Ms;bX*nx~`*FCWwfYTD$p zLZ+rppGxCaH%l?!xUSQ&s;5}i?vbjxo*p~Rf(}oOpr=#qq3bU(7-sm2ZM=y$W-I%g znjAt3H+=1{e1U8G3*Kb!VeZJScwaEO$j3H0E9V6co}Ja&*c;oYyeOpBnW>-2*=rp- zqN2l%dRkZ63#rQS<;k-9K;}xS^yPYan9t``S>&dyXTyoEX9Lgn?=Q?*t;(gFT_z9f znZe!PKDnIB!3_{*F_%ikFl*y1D`%z2GV23&)y16Z(Le}VUmIm3^7c=)u?Iqq^F?Jc z4NtM14Hk=1*k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UEI5r(fszC!_RhYsAMd(jtcvAcTLwSM8@|n zcVKhH?Sh^Pcshy-db*%EdM0?{eZ^BBbUc6_5B!NgATvC}*x4(CU{Ebjres1?YwqW* z_>rlfZ_F+Jip2-w$$0k)@op%@Nuo`X_x|p{F(=6Uve#?@AkVrOKGG#E27P ztFA*G35qsSv7WG`o8-J%QB??4H7BmQBsU6Z(FL^d*5anivtkBH;hJdgtTb%tcN2_y z9Rwl`Z^K*n2;RT}XyZr!@Aopi)eLMcigK2TD6;h^$|N79PH#lf#}P~CmTDAn8AnmU zg1QamE&+7osvJt?=ErRvfT$7T)q>)z)vUPW-4VP~kX*Tuw6(=ctK8SC@cUO%TYFxD Odg)$V?R*=!;r{`@n`6-c diff --git a/chatter/source/input/__pycache__/mailgun.cpython-36.pyc b/chatter/source/input/__pycache__/mailgun.cpython-36.pyc deleted file mode 100644 index 6ca78aff4162f3bccd6985dd42cf155407d25021..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1965 zcmZ`)TaOzx6t>5nTbgZ4FQVmA7I6`g=<-m65JCvFs1*|IOHnJ07LA6nlTJF9)Sk56 zC6SO)sZZq>0Pp+){)=CE>R;fA?>NbJDZ-KMqjPM}cfNDUjh&srZ-4%t{Twm&7dtg1 z~nz(fvn-nOFob&GWJ@tj+U3 z*x!5mpB;X$o7v&b?(y|IHxA2tMUTiG+HP)2edzf++<@Ji9hm_>I>fXjFn&P{IsJ~$ zZ|U7)JYksFCHVW8o?(SJ*KEmqKIPM31-`*AIK9G_0eF;3Ov446Mk}r)_IMmDf@!j% z^bAz=t5ESX0fv(ULqRn3{&D)#@+18a31*!D2TmMmI}$GZQBSHiOAA|qkgA=yu&$b_ zAAyx(-rsZ4tT07mN2yDUelXV-4B6fBU#^MO-1eQ(Dqmy245K}dh4Cb~#3dhK zk9fe3-`djqKQ~X<;7X!L_?+7~otUxDXZJSQiuUVgiolriR_}V+qIshk@Q3mt9I74 zRyzq+3n%IJ%XC~Or?y0RR`8~MhdiKE0~w&<0#@YNo2QBR&z+LWnFb{V(Xfwc-@vj- zI!Yx_0hbvH94+P<^)*z^hKy74##B=3QDSpAG&p*eG6yE4AB3ok@y;@!r0N z6E5C>c9LFvIfOei)0OZY4GInSV_Y~1-7ugm9t6jiw-o&A>}WuJjanu8+91!HPR(nQ zhk5>BUep^)oad@5^V~NepKacywKIDJaA(ujN?q4DcM=^0^cC0*Ri5vo#I{G52pJ61 zOCR&kYb53W<3gi(`h8$qmb{eW;Bs`U-hY#QAG4zO|NojVGV4J^6x~ Ml+T5s&)}i>2Q(7iUjP6A diff --git a/chatter/source/input/__pycache__/microsoft.cpython-36.pyc b/chatter/source/input/__pycache__/microsoft.cpython-36.pyc deleted file mode 100644 index 58f5b4e365c6ff9dccb0e43c356638796ffa0f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3569 zcmai0-ICl!6>j~_Xl7^E>m|hAI6q1pn~Y(1LJUPPRLaJ|;0s(SyhSM0R;grl@2+Mw z(zv_jU5_<4jH_~$JOOae6YvT=0T;UE%CEo`-)YU?ngle}J*`%s?$h5n=R4>2=4SUV zfB$Rv;TB{6Vr!3!@m)0aIXcd`m9dc(S{9A%%pN(RgR#Ti%pG~5hq1?7S!>h|+ZOu` z<8AK0WZW0t%n5zodCdCVSJ;X5t$Mr6)1=@c%2F+4oGHwCDidP-%4$~h9_Hgx-{bKZ z3trjHWaqJtwHS$9C$!PxAw}s?U!W5#v^WcGZiUWQ?8xFacV7CT%U$lhWFb`KZTz=5 zRKkCoclieXeJI@Hn^1UDbf9qeE9SCr14?hzo!_O2EL3r%C;#jQc<$vvO6mo1qhFv; zV!UKoai)SexQ{nz{i{M_nbL8dh(H&?vCu}k5ygCS6%`!GVg#|}DFI2AD$S3BTc4*= zBsxoT5hPiPn+IcA=preyTl;3W6RpSU&S1ccMD0H*^pT85;;fLT`$;hxh_1EkQCZP?>}k>@Z(A%oz>bg~_f$61=hIxX_SP!;*a zEA`Rdr+v5Hyj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W|DZK?yV=dCKhSu)uGMEQ~~}k8@xUv8=A!513BU6{09@nnO*<@ diff --git a/chatter/source/input/__pycache__/terminal.cpython-36.pyc b/chatter/source/input/__pycache__/terminal.cpython-36.pyc deleted file mode 100644 index ed2c5bda1bd9f62964425b486997a2b74b624e07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 820 zcmZuv!H&}~5Ve!EO{;d{$OS1k)C0?5Z!3g$Sp?#;NbHJ(70I$ASuGA zBrK7XrReyUuuNv)V$|QcRL<0m&^w_un-vhJg|AJkRUrobB3z452(9gnFV3I_Pfu+q zf{pOX8iRd+H$XbuU0uT)>K*yvfWpo&aGYrH6)b-MDUc2MoCf+S-B7Sa*T?Y!I(e;x zj9i^p?tw32&&A4F^B)DguuR+pDBT#+GV3$1^s3KXA;o+O3vKo3Uz3p73%7`uhw9|g<7p=3E@_wLM0Efr6NH(VH`~M8}@GtB+ zj6LVP5k_&|&p0<$b{gwB=kGe9cPA6hrL8!3IHBlrFQK5zAz`mkInS~r?wl{D$hzu6 z=YZAWqPKCuwI61NgnJ@58HY-J{&+C?1V5oi*qp{E{RL|> B)an2L diff --git a/chatter/source/input/__pycache__/variable_input_type_adapter.cpython-36.pyc b/chatter/source/input/__pycache__/variable_input_type_adapter.cpython-36.pyc deleted file mode 100644 index 593d96453311903361d12f7c9b3981a789211425..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2104 zcmbtVUvJ|?5Z|@ej^idL(1Gp_9bljw7>Nk!koY4G^$#t&6Qm~+Dr7~nT<_-Uo@0mI zO|K2f3+*%F3&1;{fbX)eJoPKw6Ek+2Yf-CvV56Pv%x`|Y;>$KQWOj~j&i zLoPH1<2C5&a}bS7yfZ| z2D?c}%`1~4OG_@|JkvrZxjLiuMC)NOp6GR+jKO|p)y8H|Ct8d|p;O#{-jRQ zIf*PzBb!?h<96f-TQK1aF*+bSB~hcs6nTKo<4r)<6iqrn@0BWZz zF?VN(KsG^4Kke^}Km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I87NWBwoTfz_$W ziU9BJ1Yl(1)nww=?!;fYE#HGlIEhfg++WEOI4{pzZExb~xb{|Hq18pEd%$$GkiZ;B zT1_A9`e4)QRqulotzLpD;ATCL9Y1oHD-V=X!$ykQXIT$9N^L z%ytt=m!Bn_M1T*11}0b0;M-`hzYfka*~IJ5*FhAu0NR5~4e@|r3AyaYB=LZ51W4%h zNKCFZBqT`?x{IqDh_&|*V5-DfR?#WXGLvN4RIqu8`(Bnkozt>CiL#7|Jj~xt^fc4 diff --git a/chatter/source/logic/__pycache__/logic_adapter.cpython-36.pyc b/chatter/source/logic/__pycache__/logic_adapter.cpython-36.pyc deleted file mode 100644 index ca2c83dc3f77a55fa699a41ccc248bb67e6a76de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4037 zcma)9-HzMF6(&VW;%c?FyRp$EaN2>}UZ`yrDUyp~VH9y~w2?sE8}Gc)IW=bY~xet2*& z_}f4KKK|V;$N7)5b@;gd7^nIv2JUb-buxGCx(@GfFYRRB*faNj>Sx_?*L8mB@GkGY zad=O7Yj51+{ZE`x@C9Z&Be%L!=1E*|5vGY2GD_7K9s5K75s&701(|~+n-@}tS;5Ox z#5A)xNE>}e_fm>ajjPLZ`W}K49D|Xq8R?8oJA9* zWfW@`r;$=j&mzsFm`kBVuIX8@B!^AYC>Ca}k%-cirL;7QtjUV0Sy85(!R}OKn0quZ z;>YtyMj2B&(&lv-7a3k9s>s7>na4UQ@?$6@7%%kuc|me!6`;rFk)APKuxK-%ZRWFP z{*l><4Ey@yiI_%ZN|qJu>?{>8MXqLABzedaD4ECN>}*$cKrt_JB|;_ONzymWgq{`L zsvQ9?E5KR-W(B^fUb{M-3mr}qsdU&ZOd648G5lwaE=CXMK2G&l4BFA|%2{_VI#Xxm z{>4Q&Ba~7v^Ivz&y_a^g-fIeTf91aD$!9C~qR;)c``XvR%GZ1Aj(nyEE4*2`+<%A! zFmg*H*WHm@wsPHv*p1d%b=IAg6Yg8-m1mxY+(8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ozLifTC29ZvPA68s4ShK1l?~GPJ#VAt{)uy*4Jyiq%2g zYQ`c>u}s@H!7>VSY1$`hndww_Fa!g?GrS-40zcRf-Wmp`p*|V)$@*!D(vF;vvv&rH;Gz9A{uz;hqD|4bqILZra6VDa diff --git a/chatter/source/logic/__pycache__/low_confidence.cpython-36.pyc b/chatter/source/logic/__pycache__/low_confidence.cpython-36.pyc deleted file mode 100644 index a156f975c773c368c8d6a98d04fe57acb967698f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1964 zcmaJ>&2Aev5GJ{+m8{B+lcq%v{o$#Nj95q!Bq$8S{c+GDKpPZw(8Iz7wO&%v+SF1Z zDJwSChe8H&YJomLd+!tUCE6F@wY~Tia_VqbKXzh-0!Lhu!pvLjS$vfz%-wM;D}?1hB(F;al!*hhCv*_I^;DO4r_4@qi+z8c>Nslx~NTqIO2^x z)Lyv&ZPdnYeVk{h;)2P{3Y|!EL8^n5J)2lD6uG^?vz@PmvEL;&9i(1)K7!f8+<}Ea zG3F>H9LK>6)WhDX^F|zcht5%4dx1g}N8mu@ZhxyLyDINxT;!?vk|!hYKpo6CDU2V4 z9qZiCgmTeK#?n$P%t+-%&`D+ous_K91DY;gD77X7k-vVlRLu;{m8D0yn&h2ksj_u6 zNp#n2Hmg&Fg8$C=IrQcW&-K#vnS7Ss+BORdiO zeW49}fz70fu5(HKQ56+jQ1o8s;e+KF*q?>W<{_7E7^}S#N_(HmY#m4eJFj^)*MhJ; zhJw?BlgbaN`dM0fBlH!6a}{QU6sgTr&W6GcR0Y5l%V{EIQdzzfjz=R|;=Fit)*5MX=p&bvyOE^COtex8UD=55gjg3p6E%q=yRpE5;xX0}gDPk^-@? z{0ewDC1=Fe3Sy%v(c1;-<1@l*JUT}Od4#6$2CH)fY^*|M}aG|2~h`U(Lhm zM~^=lQlqp!xl12Yu1YqIa}JrdNzOY9pM4e8VD5RJ-v!Y}1^Q|23|sJ(qhIiENCrKBHe=Bmk)Ng_MeL3X#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$`z8HmPa$=Re zq$RZmbMHgbSD+()-wE81hBTm_yXu6F1LI3xNLOj!Ill55ZOxu`%NF}>_94Qzc`k4dt{m8OmTH@wYYENh1<&NLtXXV F{{RCSIO6~S diff --git a/chatter/source/logic/__pycache__/multi_adapter.cpython-36.pyc b/chatter/source/logic/__pycache__/multi_adapter.cpython-36.pyc deleted file mode 100644 index e3517c8a2a8983cf847c7a4eab4cd11f3c52419e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4798 zcmaJ^TaVku6&_whQCexec3ihM5|=O#Cn}tUQKvz%b&PIp#Aux^(AcN}VGWw*P`i|Q zkvWvTmZ_(8k+%Tt59mvu+PD6eqA&B>zW6WrrTxzEqT41EW;7hmoH=v8bG_B?cOU%g zuS59(WB*}GkBRZG(ZoG;oN+B;u{P8+8taiB8$$zQgPV~Vw}vf@TilAQxIJuZ>^|dd zZog&R4%(;2(B_?oY|woNN^GFXooN#KDG%Hz%!AB}1m@az(`kaYcY3*|HO<3Fywl3J z-q-0-=n2#!I(h8kx>oohqmTQ<_T&W*SB(Bvj>y=6l%$lLh0I2giz zn|JvZ{%zjlef)R$Ha~~|F5ltj@xP^LT;LyoM(RX?_DMxHHL8KM(?ACrl>O+!48#2XT<(YB!iV!amQ* z0x?Mw5$vjIpTtiOfkKkrLK9cf$cf@mbI=dZl%h!mpZx_;yd;ktik??1o0claoXCx>69 zC!hWC)*)RE@;nsjH1mT)CBs7{(wgM%57^};xX3|?$MhBWBzv)?J z^}+UVyZPes(9dOG392SG>@=UV9V{=q^E84pU_U_Hjg2oI`g*ExQ0vU+X7;wQfDh*9=8H?!4zt{G3aUWt(qoo)3sB^(=dDbZ-l5R% zF`U`Xw~99Y?ZO`SfOMzmaQiY`A2m>y)jQ^J3LEze1C;c+S(t_4qLIU!{iD%@Z-RW9 z0dO+SbefY1rX$CLxkiD~1$tHR)JhS|HmrBI+pOA~c$pV3413RcgtOMH zo!rl}pmqlVUufDvMgYyecr&kf3b=Fa&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fuG%JqWvh zhW~&!{}WGM=IUwx0>P6nGo9VS8k(0dFYohxd3imUOh!MxeoOyE2>nJoBZ2*Mm~IaY zM;t3u;1pxTBOa@$h|?IOSBNLPcaC^Z#Ak7u@cw%=9b7;Jn&SFarDbNgph|jSnQ|An zb&TJdTxKsgE8%+cjvYv)BlSSv&PlKI9_c~dYiGp5uUyj<`m&>J`+h?33|vmh#@*abVnD=T$Q zq?TSXB{u*tdjCqXQvu~tu}p9RYJoQwxzswu0<;t81m}X}^0Uy5V=42c0P)gFW2IlW z^emJljIf4z2-DpMbBa#T2|kI=kiEn4DWX2cel{|pD6bo7D+q(B4fzPQ z)5Ho_8tnwstIdEj&*sdDy~{vISVJi@qZg73or!RZN5m~nr8wLT7{0O^uDgKm77d`ET+fWOZUAJ2|OQO;hPFAqK(%mNLXv0DK=YdT=24Gq<5I*o2$ zdB0rOgVLHzI5z>B8-hW@F&;+!Xmjs+Z|-joA3^I5Db=hHl-46k3&SfF_G3yvRZML? z14_BcD780%+a$bWf}-t#3DbrD>9C(f&6mIj>Y{>20jdrCQcs$Tbh+CQ&>Y@DhLYI8 St%pzAl%9rKH}EkY$NvBhYAS;O diff --git a/chatter/source/logic/__pycache__/specific_response.cpython-36.pyc b/chatter/source/logic/__pycache__/specific_response.cpython-36.pyc deleted file mode 100644 index 179e73d4e32ae123107987e7a83c6de8df23387a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1416 zcmah}PjAyO6t|tEO|y z;>I_CJD-5>k}Icu1x~!@q@_YkSn{j${{H-a&wa4E8h!ooExzLu@{=qr_$E(an|mN6 zku)b08dFLnlU~jyUhGlwl1N_$r$h$IJMm&)c6P|1dj=6?K=mdom_m{xW(azR_~J|=o> zw%iA1S?BA{F0A@w*ZJMOJ!AFW-hgjxEPOcM-B;YXadhK$KLMe$@mOgCUzy=KHi9Qj zCpH(MkiM)e)c=3}#;+-$-QASrZx7E+pCSjikYH^03T*QXge8{F$O$`OBQm33C{PV8 z&%KF%%qVCM0_mNAhv>Moe?pJF8Jjh_t|UM}uzkiL6L8<#v58d^RoFWE)2Vu8=~_Tn zV5+IoI)Iou6e24!D@5H-%i;sHD6v^t=q?()v9dbE)7qRaVdfPEe(f8TkLpfClMB(k z7KjjOo){y^rUQb|i2Cg4_Ia?DV*ZWn7UWnUyDAYQ6|4v) zYfdN~QjNo--HY}dVtoM=bp+&%GO3DGwO7zr(eW?v-4^&wuo)zlKsO^6vZI^lL2n~q zY+zK1WTIeHA|WQFta3c}g?L{jd28tkAyZH#nkw#u{IibN-WkiMH@jgZMGF&Y*9f G_PyT-s%3Wo diff --git a/chatter/source/logic/__pycache__/time_adapter.cpython-36.pyc b/chatter/source/logic/__pycache__/time_adapter.cpython-36.pyc deleted file mode 100644 index 9cbf60e9877903fb02b85e750e79d18b1473232d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3068 zcmcgu&u`nv6`mm}ic)09>$u(|yC~R2gN?FlW4plug<%A3leQ?323y4F0)hjE;fy58 z6e-V8w#8DHD!}Gcpg<43wD;Z%^#ACQ*Pik(P9se|OebGM}nc`#C0~sZuh{ee!g_ZFCM!&OW~4uc0r~Nb0o;d`smZ{QthCS-ST<`xjB<>1&{PD1af;e?gVA zoWEiVYh?9V$^XOwHUyf$HV5!ZK57v72y&t+Jkc7s3+ojNTr<-a*F;Bbh)r=_Y^`RR z;ytnblD%T1<|DS?;>N1yQty2>UqWdIqh4v#*xV_tkyknk_z|=O1Dt>GM6IB@^CU#9 ze-X~4ewc(>$NgBU%Bw+8Tt6R%OUU@K_T#*`F_bg^-N7A^`Lk^555qHQutvvU)T1Y9 zcD^3{U?potuPl_qK(S>8V2J=ri&S16^Ws)aB1=R8GlPtfqZ277#Rs(-oKSv0Jj)cW zrypfWri$$tehFY~pyX;V#jSie8%tVlJX^~TrFv2P_^rLb1u~Ol*@+KjNK385S@Dx0 z_VkwI%3+emc$g&EL#%7Z;`|aK7EnQ~^pqg7gKEG^_N+7KCD@>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xbNjbBD2Vas2 zZN_z(CQ3+_r&em7o8x!1UD^GywpDE(3tquWg8rM!?+o(@3`u5G5Xebq{u?r<04-)m_qRT^n58nq%$t)H{SAt_qM0w~8fIDGY|q&}XZy|$MUX`+lJ(Z~(p!00=(isD_eCT~ zKDhK(el}banAve(^~GQf>)8$)2?7Ne9yg;!S|xBSwot}42b(vZB+?jW)pJ>1``|&A zgC~+}spHp|%Q3I2JWaSwRXNR!DkomE`?$6XrPHOGU5<`aX=Q2epIlT@cZNuISnWFiGZR04Y2J+si@$kf%Tp;s5Gi2CD#QfS?9T z?YM@7ehSP4A{I~+e&)FPU#vvWg|(G=G@YKGpC4|Hlc-`URAQ#QN?$&h77~CJQ)D~q zB5o5c-+O&I1s`O{6wGeDi8^EA={s<$CJ@~6Nu>ASrG@iPg~ohc>ax#YIi4!^Xha#=t_fdYX#$#`COOWO@BWM0MR zsa?cHo!j(&ZJ=8dRYF4;*OcZu+5d-K%PPMBLHHN+$Iv%%C(}PTiX1EZ{brj|e66+8 z6Y7w>4bJ#>)CW*mrYNs~n}6KwcWmFB3uxAOsQ`|C0`Xem39NhtvV#HuT@M;#m4<$5!ny)J%Vv)Y z!N5gx=J*}7v>m`-gmqwn=C!f}(e;NI_ZCaXl~zu1H#GhnoD8ZSp<~dEegC=~w_PXn zcrrlg#MS`m95PlYQRirn7<*CkyjzJFgMMbrsZ@KuPjNF?xn{T1zC`9ZxNJ8F(7lgN z*iBBQQKHNchJFxuqy7Ftf8gdPA*OEm2mug9{Sge!UMrKV`%~43n)~89No%==?SIkk P{!45(gULp;Pe=YgxX)Q@ diff --git a/chatter/source/output/__pycache__/mailgun.cpython-36.pyc b/chatter/source/output/__pycache__/mailgun.cpython-36.pyc deleted file mode 100644 index 3295a1afa669c9d2179aeb0cb5819f229aa9f4c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1621 zcmZ`(Piy2h6qjUq>`W({G)+Tkp%~g6T-sdHQ&^TR3+*XWXqFy^fN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@icV@>e}HV7*gR)Oa^fvaeZ^cbn1(XpS?@Bt0Kpn+N* zMNw!2yG8wd{A~su8te_t_Oic9WR^jW&H^yWH9BtjQ{|`3t*QPI|Iv-W58euH4}IJG yL0jl}QUM&$QIXZ#gtODOW6`pGR}|Ow#F|k%vpq}j%hpW4BG*}6M`%(;?*9Np-&)K7 diff --git a/chatter/source/output/__pycache__/output_adapter.cpython-36.pyc b/chatter/source/output/__pycache__/output_adapter.cpython-36.pyc deleted file mode 100644 index 478d6c14fd5452c82f9edb75f3aef1088f1d9f8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 974 zcmZuvL2KJE6qaIVO-%zk?=W-?Y++E?A&k*bSlJ~Vtn6R{La|_Z7Bbf|;<9jlp&Cy(n%7e}DxE~Sj&TzVCxByA1B>0Y|ksQiM z#&(KSGDg!c3%^QW6rKYgH;*J3gH~{x$rC#nyrAD4OpwB1Uzk-V6I;E zNrqL{Y?K5Bw;r?v*@CTWoq1)nD3ss6!2B#{!Z8VjLMWxL5yXP4jCR1hVMsIo@SY(+ zWt8^Q7G#lylEMgIit`+&3!Z(ZSO^ubFxaMs0xmm|h?gtJO7OXnOlf2~l&i|BfD$y; zRy%J>wFAi>$(<&9$XO+3kR!jB8hOOoC5N8LC5H+4c6lVLOBT#FJoZxYT+^s@;26V7jHQS>)QoJ*5& zZjbK;KS;Nu5DR@1s%d*>6vu-$vOohyy;^63sy2M^xOE^PG@~~i`PV!Z diff --git a/chatter/source/output/__pycache__/terminal.cpython-36.pyc b/chatter/source/output/__pycache__/terminal.cpython-36.pyc deleted file mode 100644 index 98a931b434864eea4a3c7c4b6d728af61b2c222e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 757 zcmZ8f&2H2%5Vqr_UBWKxnNw~k67*6oAcR_0YHtOJibE913b9Lr>^RttC@T&~?PGA@ z%8lpol~Z4V6En^(T6LuPiD&%HH{%>G7Wwb*KdPUUkUwNcQizX0-4if^2&#yt6{SQZ zf~iEaicxY(L@KfyA~MOYS(S>tcck3Eg&U-#VLA3)YlP&g^U^lT-9i&gEZ&TM82zzm z21vA6z7+<+5vY3vMv{sOQYC^`Ok{$I^oBx{1e)xHhv(Aju5Z)^W?kh4$Z_F1Jt$c; z6MEq<8(%a^nJ=zbK@1&V8((-6%Uh#0(rmnhN^8cCm*64ZfFH!Fvle-wpie+opl%7q zlW+7By@ti02WE8rJl;VvZ*A8@E5NhT4W@ShY~uImqP3An^-!OftEcY|>vo!Q>pvJ@o4D}$ z|5U@*upF#u0gG>`A(q2uCuvUC#hvvY+$}HZS($|y=Y69k=OO1@8!;-3=bV2Y8@0*o zb1qEFxm^Huq`YJ1c$R@djqPV?n#2>t2h@wvj}}lZ?max1M&X<1wMaNt?_lC27J@4sX`9QNOyUuc05dPi%E06&If_W=YFSR#cf#-2wqQZbDKk0ntF zO#&x!L!~qY-lv)9m8ckefG;X=mzPc(K5I?{Z(UgJX^c7atyK!2kdN diff --git a/chatter/source/storage/__pycache__/django_storage.cpython-36.pyc b/chatter/source/storage/__pycache__/django_storage.cpython-36.pyc deleted file mode 100644 index c8e1f3a95e90e6ebfd297d27a3e0ebdd7eb6f3c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6425 zcmb_hOK;rP73Q0q(P(7L^4p2oG)*$CD+Ec~w1whUk?pi@I(99m4hS_YJ(rR>9+Bfq z%CZJjHwuuIg6z^&R|Sgf+I?3=e?Zq<73eB|A*+7pUJgmgqZBD3WA20Zd7j@n*Kf|x zx1ap=PhNCcQU0Se{tUE#j$e8W1yh(hQnpo3RTZW&9c|6iROMZT8O;1hVP>cv=$_83 zb){#2p<+o-ExPMj!h@}Fl?CH0p=b8C>qX%@s;I>3kOPcK{PAJGUEPi2ayG1b#Q zRyI{S^drYJNY#YPNSYQ4qIYp zQO~n;>^$l&yTC4@USOBlWz?tG74`z^)9gid74;%>*|$)i`B*U&ZwbV`R4m;X2Ju#M zl(xx-Z5My#M>miZyV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m5*P|{sFvd=ItCDAD+`5|~C-B1nfE7HPa z8&nR7#PpR83DF%1O@~ml$+b!-Yr;W;k8!wrgoU*w6`dxHN1V_KPA#;EAsG-lN;x6_ z1r^8i@r>l{k+kb`%uDGJK{(`-a^V>Z2O@pOx)!a)ZwknyplW#RY z8(=EYwu!I(BiYAKK$8GZPMr4Un;YVdCSa`BlAOOqGbgNA@=DQlLGufB|r%e^l&G_|L4(nmb`>&7drCi ze$xyfh|!3@12TH1lt%5Lg+)++aGb>k?UE qqT@KHovxTqCioUDCPyNks>SE}1lbY~vCfJl`#Qa`ix?RBp#EP|)hV+8 diff --git a/chatter/source/storage/__pycache__/mongodb.cpython-36.pyc b/chatter/source/storage/__pycache__/mongodb.cpython-36.pyc deleted file mode 100644 index 4ef2bb1f60a44735d3092b91c7566932c162493c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9350 zcmb7KPjDO8dEb9nEI<&XC`y*(SYA6!WTY}B%Wmy5wqyNGlg4x^DVBpOgIVG|k_!U6 z(A$MbV8C`J^dyIlb?zbUWICPcbb9Gb554u!LrBglqycAl z-@bi+zrVlldwhF&x%yZC{MXHYxNaE#Wz75>lt03i+{8^7!t5G7vuT>f_YGkQ`*TCs z(mJu5Hr^dk!h1=Ycz1;R$Y_+mG|{bLX7xvDtb#pxTLk@7sy1r#pN-N-xRO7@O&U#8 z7)>iQc1>Xl>vOYd3tKp!8yK=ATs%vnEId42Q4v)<%VJ5?@btv8sN-1?E0}sUEB(np zs$tv0sPv;JU3YOMRouqr*l1x-Xl!m{jiqPQzF}ofBD=eacK-KT9uB`-_g%6QF6&x7tjR#2SIwWR0b`kV$t z>YN7Oz{_|t(XlnQI@Z`c0cTTtY@L{zDh^MrXyD8p^hJPO(;y9-mytQB33MCU=*)_2 z6&%)3l~BE5R;{Wvs^~T0%iM}+K;HTl6lPXrjxAxnZ=_fougBWXoKzmAn4FlytD0L) zJxQ^^o{Z8KwOhEZ3-fJS^4TEhCg(9;zE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EZYSk%V{sw;%ZZ_$lBEdOn~ZO}~^=r^hL zhjb&mE(3y(sr4z{Jh~myEuRF*>LgEkUC@15%X)v zMQ@mm{I6v$n@i>`^9^&=ylP%HFH*l)v5kL`QaI_p$je3Flx_)v3KwC%B~gC|^pr~0 I*3H`g0A^p5uK)l5 diff --git a/chatter/source/storage/__pycache__/storage_adapter.cpython-36.pyc b/chatter/source/storage/__pycache__/storage_adapter.cpython-36.pyc deleted file mode 100644 index b3b34df6644fd40c6c4b7244d0abbc12e92ae01c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6517 zcmb_hTW=f372f48DT6E4WNk8H&?Ditj1^1?+-wA33 ze1smoKgB!!9)^)KvOJ6jHn+3dfs?tX_Gt~@)j5p~PQNd3homvwQLEAEKaRsJ^rLVn zSdetP2`-UkGTiNFf)3$J!P)MB%{!w$5-pN9qGWGR$fr9S&AjpA$d`L*?(B&yU!Wht zcrRbX(=QcK-t@fK?+VY84$hrlE$-~4{a!DTS?ay)3mJ+uZ|(Z2P)~ymH+NGJb!3ZJ zT-rd=_5W_k^O(N8|L7;rpNekp`A5m|-Cx~%9sqg(UCz5n_Pl_&oV{Y(&E9}c6aoj& zqt(+U2Fq>Om+Xc;yfP{C&609P5RZuU0fv!%V4Yeg5W~ps*z49wZ3F=v*e@FL4$TL6 zK7~VL+6a-$#+bacE7^j&Z2VxqewLK9F ziSv1te&52rX#)c(-jY4MIRn%TOJEZ@UNn_)r2r_P;+P}Az<8p>SGr){#RNU|G z3dxcVgL@%+gKts*aX<6vWEC>QA3X(dp9e`l&OT>a^yKp5B&$4>b`%+T!_u^NHtd{j zX_xkiQkb12`?z#zf^3^z6Qwh8UUO|wxO53Z?J7Z ztu9Ytt7(jVm3s9HVwz`P{w0{8xtBIEQmqK8L-wUrtU!vcJ!@ffWgRzJ&zJD#@INd- zN)aS+=EE=vb8WF^BdlD->P_}(91YA?NBd#0UosmGisE!Am}K}RqC#Gq53gN~*- z13G^+=#*Mc>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chatter/{source => chatterbot}/__init__.py | 2 +- chatter/{source => chatterbot}/__main__.py | 0 chatter/{source => chatterbot}/adapters.py | 2 +- chatter/{source => chatterbot}/chatterbot.py | 14 +++++++------- chatter/{source => chatterbot}/comparisons.py | 2 +- chatter/{source => chatterbot}/constants.py | 0 chatter/{source => chatterbot}/conversation.py | 0 chatter/{source => chatterbot}/corpus.py | 0 chatter/{source => chatterbot}/ext/__init__.py | 0 .../chatterbot/ext/django_chatterbot/__init__.py | 3 +++ .../ext/django_chatterbot/abstract_models.py | 4 ++-- .../ext/django_chatterbot/admin.py | 2 +- .../ext/django_chatterbot/apps.py | 2 +- .../ext/django_chatterbot/factories.py | 4 ++-- .../ext/django_chatterbot/management/__init__.py | 0 .../management/commands/__init__.py | 0 .../management/commands/train.py | 4 ++-- .../django_chatterbot/migrations/0001_initial.py | 0 .../migrations/0002_statement_extra_data.py | 0 .../migrations/0003_change_occurrence_default.py | 0 .../migrations/0004_rename_in_response_to.py | 0 .../migrations/0005_statement_created_at.py | 0 .../migrations/0006_create_conversation.py | 0 .../migrations/0007_response_created_at.py | 0 .../migrations/0008_update_conversations.py | 0 .../django_chatterbot/migrations/0009_tags.py | 0 .../migrations/0010_statement_text.py | 0 .../migrations/0011_blank_extra_data.py | 0 .../ext/django_chatterbot/migrations/__init__.py | 0 .../ext/django_chatterbot/models.py | 2 +- .../ext/django_chatterbot/settings.py | 8 ++++---- .../ext/django_chatterbot/urls.py | 0 .../ext/django_chatterbot/views.py | 6 +++--- .../ext/sqlalchemy_app/__init__.py | 0 .../ext/sqlalchemy_app/models.py | 10 +++++----- .../ext/sqlalchemy_app/types.py | 0 chatter/{source => chatterbot}/filters.py | 0 chatter/{source => chatterbot}/input/__init__.py | 0 chatter/{source => chatterbot}/input/gitter.py | 4 ++-- chatter/{source => chatterbot}/input/hipchat.py | 4 ++-- .../input/input_adapter.py | 2 +- chatter/{source => chatterbot}/input/mailgun.py | 4 ++-- .../{source => chatterbot}/input/microsoft.py | 4 ++-- chatter/{source => chatterbot}/input/terminal.py | 6 +++--- .../input/variable_input_type_adapter.py | 4 ++-- chatter/{source => chatterbot}/logic/__init__.py | 0 .../{source => chatterbot}/logic/best_match.py | 0 .../logic/logic_adapter.py | 8 ++++---- .../logic/low_confidence.py | 2 +- .../logic/mathematical_evaluation.py | 4 ++-- .../logic/multi_adapter.py | 4 ++-- .../logic/no_knowledge_adapter.py | 0 .../logic/specific_response.py | 2 +- .../{source => chatterbot}/logic/time_adapter.py | 2 +- .../{source => chatterbot}/output/__init__.py | 0 chatter/{source => chatterbot}/output/gitter.py | 0 chatter/{source => chatterbot}/output/hipchat.py | 0 chatter/{source => chatterbot}/output/mailgun.py | 0 .../{source => chatterbot}/output/microsoft.py | 0 .../output/output_adapter.py | 2 +- .../{source => chatterbot}/output/terminal.py | 0 chatter/{source => chatterbot}/parsing.py | 0 chatter/{source => chatterbot}/preprocessors.py | 0 .../{source => chatterbot}/response_selection.py | 0 .../{source => chatterbot}/storage/__init__.py | 0 .../storage/django_storage.py | 4 ++-- .../{source => chatterbot}/storage/mongodb.py | 6 +++--- .../storage/sql_storage.py | 16 ++++++++-------- .../storage/storage_adapter.py | 0 chatter/{source => chatterbot}/trainers.py | 0 chatter/{source => chatterbot}/utils.py | 0 chatter/source/ext/django_chatterbot/__init__.py | 3 --- 73 files changed, 80 insertions(+), 76 deletions(-) rename chatter/{source => chatterbot}/__init__.py (91%) rename chatter/{source => chatterbot}/__main__.py (100%) rename chatter/{source => chatterbot}/adapters.py (96%) rename chatter/{source => chatterbot}/chatterbot.py (91%) rename chatter/{source => chatterbot}/comparisons.py (99%) rename chatter/{source => chatterbot}/constants.py (100%) rename chatter/{source => chatterbot}/conversation.py (100%) rename chatter/{source => chatterbot}/corpus.py (100%) rename chatter/{source => chatterbot}/ext/__init__.py (100%) create mode 100644 chatter/chatterbot/ext/django_chatterbot/__init__.py rename chatter/{source => chatterbot}/ext/django_chatterbot/abstract_models.py (98%) rename chatter/{source => chatterbot}/ext/django_chatterbot/admin.py (93%) rename chatter/{source => chatterbot}/ext/django_chatterbot/apps.py (74%) rename chatter/{source => chatterbot}/ext/django_chatterbot/factories.py (89%) rename chatter/{source => chatterbot}/ext/django_chatterbot/management/__init__.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/management/commands/__init__.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/management/commands/train.py (88%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0001_initial.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0002_statement_extra_data.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0003_change_occurrence_default.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0004_rename_in_response_to.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0005_statement_created_at.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0006_create_conversation.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0007_response_created_at.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0008_update_conversations.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0009_tags.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0010_statement_text.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/0011_blank_extra_data.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/migrations/__init__.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/models.py (90%) rename chatter/{source => chatterbot}/ext/django_chatterbot/settings.py (59%) rename chatter/{source => chatterbot}/ext/django_chatterbot/urls.py (100%) rename chatter/{source => chatterbot}/ext/django_chatterbot/views.py (95%) rename chatter/{source => chatterbot}/ext/sqlalchemy_app/__init__.py (100%) rename chatter/{source => chatterbot}/ext/sqlalchemy_app/models.py (89%) rename chatter/{source => chatterbot}/ext/sqlalchemy_app/types.py (100%) rename chatter/{source => chatterbot}/filters.py (100%) rename chatter/{source => chatterbot}/input/__init__.py (100%) rename chatter/{source => chatterbot}/input/gitter.py (98%) rename chatter/{source => chatterbot}/input/hipchat.py (97%) rename chatter/{source => chatterbot}/input/input_adapter.py (96%) rename chatter/{source => chatterbot}/input/mailgun.py (94%) rename chatter/{source => chatterbot}/input/microsoft.py (97%) rename chatter/{source => chatterbot}/input/terminal.py (73%) rename chatter/{source => chatterbot}/input/variable_input_type_adapter.py (95%) rename chatter/{source => chatterbot}/logic/__init__.py (100%) rename chatter/{source => chatterbot}/logic/best_match.py (100%) rename chatter/{source => chatterbot}/logic/logic_adapter.py (94%) rename chatter/{source => chatterbot}/logic/low_confidence.py (97%) rename chatter/{source => chatterbot}/logic/mathematical_evaluation.py (95%) rename chatter/{source => chatterbot}/logic/multi_adapter.py (98%) rename chatter/{source => chatterbot}/logic/no_knowledge_adapter.py (100%) rename chatter/{source => chatterbot}/logic/specific_response.py (94%) rename chatter/{source => chatterbot}/logic/time_adapter.py (98%) rename chatter/{source => chatterbot}/output/__init__.py (100%) rename chatter/{source => chatterbot}/output/gitter.py (100%) rename chatter/{source => chatterbot}/output/hipchat.py (100%) rename chatter/{source => chatterbot}/output/mailgun.py (100%) rename chatter/{source => chatterbot}/output/microsoft.py (100%) rename chatter/{source => chatterbot}/output/output_adapter.py (93%) rename chatter/{source => chatterbot}/output/terminal.py (100%) rename chatter/{source => chatterbot}/parsing.py (100%) rename chatter/{source => chatterbot}/preprocessors.py (100%) rename chatter/{source => chatterbot}/response_selection.py (100%) rename chatter/{source => chatterbot}/storage/__init__.py (100%) rename chatter/{source => chatterbot}/storage/django_storage.py (98%) rename chatter/{source => chatterbot}/storage/mongodb.py (98%) rename chatter/{source => chatterbot}/storage/sql_storage.py (96%) rename chatter/{source => chatterbot}/storage/storage_adapter.py (100%) rename chatter/{source => chatterbot}/trainers.py (100%) rename chatter/{source => chatterbot}/utils.py (100%) delete mode 100644 chatter/source/ext/django_chatterbot/__init__.py diff --git a/chatter/chatter.py b/chatter/chatter.py index 3678324..0a083a9 100644 --- a/chatter/chatter.py +++ b/chatter/chatter.py @@ -5,8 +5,8 @@ import discord from discord.ext import commands from redbot.core import Config -from .source import ChatBot -from .source.trainers import ListTrainer +from .chatterbot import ChatBot +from .chatterbot.trainers import ListTrainer class Chatter: @@ -23,7 +23,11 @@ class Chatter: "days": 1 } - self.chatbot = ChatBot("ChatterBot") + self.chatbot = ChatBot( + "ChatterBot", + storage_adapter='chatterbot.storage.SQLStorageAdapter', + database='./database.sqlite3' + ) self.chatbot.set_trainer(ListTrainer) self.config.register_global(**default_global) diff --git a/chatter/source/__init__.py b/chatter/chatterbot/__init__.py similarity index 91% rename from chatter/source/__init__.py rename to chatter/chatterbot/__init__.py index 2ea55f6..7a127ee 100644 --- a/chatter/source/__init__.py +++ b/chatter/chatterbot/__init__.py @@ -3,7 +3,7 @@ ChatterBot is a machine learning, conversational dialog engine. """ from .chatterbot import ChatBot -__version__ = '0.8.4' +__version__ = '0.8.5' __author__ = 'Gunther Cox' __email__ = 'gunthercx@gmail.com' __url__ = 'https://github.com/gunthercox/ChatterBot' diff --git a/chatter/source/__main__.py b/chatter/chatterbot/__main__.py similarity index 100% rename from chatter/source/__main__.py rename to chatter/chatterbot/__main__.py diff --git a/chatter/source/adapters.py b/chatter/chatterbot/adapters.py similarity index 96% rename from chatter/source/adapters.py rename to chatter/chatterbot/adapters.py index f99734d..83ce94c 100644 --- a/chatter/source/adapters.py +++ b/chatter/chatterbot/adapters.py @@ -16,7 +16,7 @@ class Adapter(object): """ Gives the adapter access to an instance of the ChatBot class. - :param chatbot: A chat bot instanse. + :param chatbot: A chat bot instance. :type chatbot: ChatBot """ self.chatbot = chatbot diff --git a/chatter/source/chatterbot.py b/chatter/chatterbot/chatterbot.py similarity index 91% rename from chatter/source/chatterbot.py rename to chatter/chatterbot/chatterbot.py index 66a92b9..2a5049d 100644 --- a/chatter/source/chatterbot.py +++ b/chatter/chatterbot/chatterbot.py @@ -20,15 +20,15 @@ class ChatBot(object): self.default_session = None - storage_adapter = kwargs.get('storage_adapter', 'chatter.source.storage.SQLStorageAdapter') + storage_adapter = kwargs.get('storage_adapter', 'chatterbot.storage.SQLStorageAdapter') logic_adapters = kwargs.get('logic_adapters', [ - 'chatter.source.logic.BestMatch' + 'chatterbot.logic.BestMatch' ]) - input_adapter = kwargs.get('input_adapter', 'chatter.source.input.VariableInputTypeAdapter') + input_adapter = kwargs.get('input_adapter', 'chatterbot.input.VariableInputTypeAdapter') - output_adapter = kwargs.get('output_adapter', 'chatter.source.output.OutputAdapter') + output_adapter = kwargs.get('output_adapter', 'chatterbot.output.OutputAdapter') # Check that each adapter is a valid subclass of it's respective parent utils.validate_adapter_class(storage_adapter, StorageAdapter) @@ -45,7 +45,7 @@ class ChatBot(object): # Add required system logic adapter self.logic.system_adapters.append( - utils.initialize_class('chatter.source.logic.NoKnowledgeAdapter', **kwargs) + utils.initialize_class('chatterbot.logic.NoKnowledgeAdapter', **kwargs) ) for adapter in logic_adapters: @@ -59,7 +59,7 @@ class ChatBot(object): preprocessors = kwargs.get( 'preprocessors', [ - 'chatter.source.preprocessors.clean_whitespace' + 'chatterbot.preprocessors.clean_whitespace' ] ) @@ -69,7 +69,7 @@ class ChatBot(object): self.preprocessors.append(utils.import_module(preprocessor)) # Use specified trainer or fall back to the default - trainer = kwargs.get('trainer', 'chatter.source.trainers.Trainer') + trainer = kwargs.get('trainer', 'chatterbot.trainers.Trainer') TrainerClass = utils.import_module(trainer) self.trainer = TrainerClass(self.storage, **kwargs) self.training_data = kwargs.get('training_data') diff --git a/chatter/source/comparisons.py b/chatter/chatterbot/comparisons.py similarity index 99% rename from chatter/source/comparisons.py rename to chatter/chatterbot/comparisons.py index 816e175..c500487 100644 --- a/chatter/source/comparisons.py +++ b/chatter/chatterbot/comparisons.py @@ -130,7 +130,7 @@ class SynsetDistance(Comparator): """ from nltk.corpus import wordnet from nltk import word_tokenize - from . import utils + from chatterbot import utils import itertools tokens1 = word_tokenize(statement.text.lower()) diff --git a/chatter/source/constants.py b/chatter/chatterbot/constants.py similarity index 100% rename from chatter/source/constants.py rename to chatter/chatterbot/constants.py diff --git a/chatter/source/conversation.py b/chatter/chatterbot/conversation.py similarity index 100% rename from chatter/source/conversation.py rename to chatter/chatterbot/conversation.py diff --git a/chatter/source/corpus.py b/chatter/chatterbot/corpus.py similarity index 100% rename from chatter/source/corpus.py rename to chatter/chatterbot/corpus.py diff --git a/chatter/source/ext/__init__.py b/chatter/chatterbot/ext/__init__.py similarity index 100% rename from chatter/source/ext/__init__.py rename to chatter/chatterbot/ext/__init__.py diff --git a/chatter/chatterbot/ext/django_chatterbot/__init__.py b/chatter/chatterbot/ext/django_chatterbot/__init__.py new file mode 100644 index 0000000..0bd8684 --- /dev/null +++ b/chatter/chatterbot/ext/django_chatterbot/__init__.py @@ -0,0 +1,3 @@ +default_app_config = ( + 'chatterbot.ext.django_chatterbot.apps.DjangoChatterBotConfig' +) diff --git a/chatter/source/ext/django_chatterbot/abstract_models.py b/chatter/chatterbot/ext/django_chatterbot/abstract_models.py similarity index 98% rename from chatter/source/ext/django_chatterbot/abstract_models.py rename to chatter/chatterbot/ext/django_chatterbot/abstract_models.py index 4531186..59c9cea 100644 --- a/chatter/source/ext/django_chatterbot/abstract_models.py +++ b/chatter/chatterbot/ext/django_chatterbot/abstract_models.py @@ -1,5 +1,5 @@ -from ...conversation import StatementMixin -from ... import constants +from chatterbot.conversation import StatementMixin +from chatterbot import constants from django.db import models from django.apps import apps from django.utils import timezone diff --git a/chatter/source/ext/django_chatterbot/admin.py b/chatter/chatterbot/ext/django_chatterbot/admin.py similarity index 93% rename from chatter/source/ext/django_chatterbot/admin.py rename to chatter/chatterbot/ext/django_chatterbot/admin.py index 193c264..a641883 100644 --- a/chatter/source/ext/django_chatterbot/admin.py +++ b/chatter/chatterbot/ext/django_chatterbot/admin.py @@ -1,5 +1,5 @@ from django.contrib import admin -from .models import ( +from chatterbot.ext.django_chatterbot.models import ( Statement, Response, Conversation, Tag ) diff --git a/chatter/source/ext/django_chatterbot/apps.py b/chatter/chatterbot/ext/django_chatterbot/apps.py similarity index 74% rename from chatter/source/ext/django_chatterbot/apps.py rename to chatter/chatterbot/ext/django_chatterbot/apps.py index b873e3e..13f8fe0 100644 --- a/chatter/source/ext/django_chatterbot/apps.py +++ b/chatter/chatterbot/ext/django_chatterbot/apps.py @@ -3,6 +3,6 @@ from django.apps import AppConfig class DjangoChatterBotConfig(AppConfig): - name = 'chatter.source.ext.django_chatterbot' + name = 'chatterbot.ext.django_chatterbot' label = 'django_chatterbot' verbose_name = 'Django ChatterBot' diff --git a/chatter/source/ext/django_chatterbot/factories.py b/chatter/chatterbot/ext/django_chatterbot/factories.py similarity index 89% rename from chatter/source/ext/django_chatterbot/factories.py rename to chatter/chatterbot/ext/django_chatterbot/factories.py index 7367b58..4ac52b8 100644 --- a/chatter/source/ext/django_chatterbot/factories.py +++ b/chatter/chatterbot/ext/django_chatterbot/factories.py @@ -2,8 +2,8 @@ These factories are used to generate fake data for testing. """ import factory -from . import models -from ... import constants +from chatterbot.ext.django_chatterbot import models +from chatterbot import constants from factory.django import DjangoModelFactory diff --git a/chatter/source/ext/django_chatterbot/management/__init__.py b/chatter/chatterbot/ext/django_chatterbot/management/__init__.py similarity index 100% rename from chatter/source/ext/django_chatterbot/management/__init__.py rename to chatter/chatterbot/ext/django_chatterbot/management/__init__.py diff --git a/chatter/source/ext/django_chatterbot/management/commands/__init__.py b/chatter/chatterbot/ext/django_chatterbot/management/commands/__init__.py similarity index 100% rename from chatter/source/ext/django_chatterbot/management/commands/__init__.py rename to chatter/chatterbot/ext/django_chatterbot/management/commands/__init__.py diff --git a/chatter/source/ext/django_chatterbot/management/commands/train.py b/chatter/chatterbot/ext/django_chatterbot/management/commands/train.py similarity index 88% rename from chatter/source/ext/django_chatterbot/management/commands/train.py rename to chatter/chatterbot/ext/django_chatterbot/management/commands/train.py index d4810b8..50af70d 100644 --- a/chatter/source/ext/django_chatterbot/management/commands/train.py +++ b/chatter/chatterbot/ext/django_chatterbot/management/commands/train.py @@ -11,8 +11,8 @@ class Command(BaseCommand): can_import_settings = True def handle(self, *args, **options): - from ..... import ChatBot - from ... import settings + from chatterbot import ChatBot + from chatterbot.ext.django_chatterbot import settings chatterbot = ChatBot(**settings.CHATTERBOT) diff --git a/chatter/source/ext/django_chatterbot/migrations/0001_initial.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0001_initial.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0001_initial.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0001_initial.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0002_statement_extra_data.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0002_statement_extra_data.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0003_change_occurrence_default.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0003_change_occurrence_default.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0004_rename_in_response_to.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0004_rename_in_response_to.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0005_statement_created_at.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0005_statement_created_at.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0006_create_conversation.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0006_create_conversation.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0007_response_created_at.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0007_response_created_at.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0008_update_conversations.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0008_update_conversations.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0009_tags.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0009_tags.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0009_tags.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0009_tags.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0010_statement_text.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0010_statement_text.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py diff --git a/chatter/source/ext/django_chatterbot/migrations/0011_blank_extra_data.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/0011_blank_extra_data.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py diff --git a/chatter/source/ext/django_chatterbot/migrations/__init__.py b/chatter/chatterbot/ext/django_chatterbot/migrations/__init__.py similarity index 100% rename from chatter/source/ext/django_chatterbot/migrations/__init__.py rename to chatter/chatterbot/ext/django_chatterbot/migrations/__init__.py diff --git a/chatter/source/ext/django_chatterbot/models.py b/chatter/chatterbot/ext/django_chatterbot/models.py similarity index 90% rename from chatter/source/ext/django_chatterbot/models.py rename to chatter/chatterbot/ext/django_chatterbot/models.py index ac51c06..d82a603 100644 --- a/chatter/source/ext/django_chatterbot/models.py +++ b/chatter/chatterbot/ext/django_chatterbot/models.py @@ -1,4 +1,4 @@ -from .abstract_models import ( +from chatterbot.ext.django_chatterbot.abstract_models import ( AbstractBaseConversation, AbstractBaseResponse, AbstractBaseStatement, AbstractBaseTag ) diff --git a/chatter/source/ext/django_chatterbot/settings.py b/chatter/chatterbot/ext/django_chatterbot/settings.py similarity index 59% rename from chatter/source/ext/django_chatterbot/settings.py rename to chatter/chatterbot/ext/django_chatterbot/settings.py index 802b77d..ed5ca46 100644 --- a/chatter/source/ext/django_chatterbot/settings.py +++ b/chatter/chatterbot/ext/django_chatterbot/settings.py @@ -2,16 +2,16 @@ Default ChatterBot settings for Django. """ from django.conf import settings -from ... import constants +from chatterbot import constants CHATTERBOT_SETTINGS = getattr(settings, 'CHATTERBOT', {}) CHATTERBOT_DEFAULTS = { 'name': 'ChatterBot', - 'storage_adapter': 'chatter.source.storage.DjangoStorageAdapter', - 'input_adapter': 'chatter.source.input.VariableInputTypeAdapter', - 'output_adapter': 'chatter.source.output.OutputAdapter', + 'storage_adapter': 'chatterbot.storage.DjangoStorageAdapter', + 'input_adapter': 'chatterbot.input.VariableInputTypeAdapter', + 'output_adapter': 'chatterbot.output.OutputAdapter', 'django_app_name': constants.DEFAULT_DJANGO_APP_NAME } diff --git a/chatter/source/ext/django_chatterbot/urls.py b/chatter/chatterbot/ext/django_chatterbot/urls.py similarity index 100% rename from chatter/source/ext/django_chatterbot/urls.py rename to chatter/chatterbot/ext/django_chatterbot/urls.py diff --git a/chatter/source/ext/django_chatterbot/views.py b/chatter/chatterbot/ext/django_chatterbot/views.py similarity index 95% rename from chatter/source/ext/django_chatterbot/views.py rename to chatter/chatterbot/ext/django_chatterbot/views.py index d73408e..ff4d12b 100644 --- a/chatter/source/ext/django_chatterbot/views.py +++ b/chatter/chatterbot/ext/django_chatterbot/views.py @@ -1,8 +1,8 @@ import json from django.views.generic import View from django.http import JsonResponse -from ... import ChatBot -from . import settings +from chatterbot import ChatBot +from chatterbot.ext.django_chatterbot import settings class ChatterBotViewMixin(object): @@ -28,7 +28,7 @@ class ChatterBotViewMixin(object): Return the conversation for the session if one exists. Create a new conversation if one does not exist. """ - from .models import Conversation, Response + from chatterbot.ext.django_chatterbot.models import Conversation, Response class Obj(object): def __init__(self): diff --git a/chatter/source/ext/sqlalchemy_app/__init__.py b/chatter/chatterbot/ext/sqlalchemy_app/__init__.py similarity index 100% rename from chatter/source/ext/sqlalchemy_app/__init__.py rename to chatter/chatterbot/ext/sqlalchemy_app/__init__.py diff --git a/chatter/source/ext/sqlalchemy_app/models.py b/chatter/chatterbot/ext/sqlalchemy_app/models.py similarity index 89% rename from chatter/source/ext/sqlalchemy_app/models.py rename to chatter/chatterbot/ext/sqlalchemy_app/models.py index 9f1b0d3..cba4a47 100644 --- a/chatter/source/ext/sqlalchemy_app/models.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/models.py @@ -3,9 +3,9 @@ from sqlalchemy.orm import relationship from sqlalchemy.sql import func from sqlalchemy.ext.declarative import declared_attr, declarative_base -from ...constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH -from .types import UnicodeString -from ...conversation import StatementMixin +from chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH +from chatterbot.ext.sqlalchemy_app.types import UnicodeString +from chatterbot.conversation import StatementMixin class ModelBase(object): @@ -73,8 +73,8 @@ class Statement(Base, StatementMixin): return [tag.name for tag in self.tags] def get_statement(self): - from ...conversation import Statement as StatementObject - from ...conversation import Response as ResponseObject + from chatterbot.conversation import Statement as StatementObject + from chatterbot.conversation import Response as ResponseObject statement = StatementObject( self.text, diff --git a/chatter/source/ext/sqlalchemy_app/types.py b/chatter/chatterbot/ext/sqlalchemy_app/types.py similarity index 100% rename from chatter/source/ext/sqlalchemy_app/types.py rename to chatter/chatterbot/ext/sqlalchemy_app/types.py diff --git a/chatter/source/filters.py b/chatter/chatterbot/filters.py similarity index 100% rename from chatter/source/filters.py rename to chatter/chatterbot/filters.py diff --git a/chatter/source/input/__init__.py b/chatter/chatterbot/input/__init__.py similarity index 100% rename from chatter/source/input/__init__.py rename to chatter/chatterbot/input/__init__.py diff --git a/chatter/source/input/gitter.py b/chatter/chatterbot/input/gitter.py similarity index 98% rename from chatter/source/input/gitter.py rename to chatter/chatterbot/input/gitter.py index 6ed83db..db97772 100644 --- a/chatter/source/input/gitter.py +++ b/chatter/chatterbot/input/gitter.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from time import sleep -from . import InputAdapter -from ..conversation import Statement +from chatterbot.input import InputAdapter +from chatterbot.conversation import Statement class Gitter(InputAdapter): diff --git a/chatter/source/input/hipchat.py b/chatter/chatterbot/input/hipchat.py similarity index 97% rename from chatter/source/input/hipchat.py rename to chatter/chatterbot/input/hipchat.py index b251157..57cf4d6 100644 --- a/chatter/source/input/hipchat.py +++ b/chatter/chatterbot/input/hipchat.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from time import sleep -from . import InputAdapter -from ..conversation import Statement +from chatterbot.input import InputAdapter +from chatterbot.conversation import Statement class HipChat(InputAdapter): diff --git a/chatter/source/input/input_adapter.py b/chatter/chatterbot/input/input_adapter.py similarity index 96% rename from chatter/source/input/input_adapter.py rename to chatter/chatterbot/input/input_adapter.py index 3bc4b08..17b1dbe 100644 --- a/chatter/source/input/input_adapter.py +++ b/chatter/chatterbot/input/input_adapter.py @@ -1,5 +1,5 @@ from __future__ import unicode_literals -from ..adapters import Adapter +from chatterbot.adapters import Adapter class InputAdapter(Adapter): diff --git a/chatter/source/input/mailgun.py b/chatter/chatterbot/input/mailgun.py similarity index 94% rename from chatter/source/input/mailgun.py rename to chatter/chatterbot/input/mailgun.py index b1fe705..199a677 100644 --- a/chatter/source/input/mailgun.py +++ b/chatter/chatterbot/input/mailgun.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import datetime -from . import InputAdapter -from ..conversation import Statement +from chatterbot.input import InputAdapter +from chatterbot.conversation import Statement class Mailgun(InputAdapter): diff --git a/chatter/source/input/microsoft.py b/chatter/chatterbot/input/microsoft.py similarity index 97% rename from chatter/source/input/microsoft.py rename to chatter/chatterbot/input/microsoft.py index 395a3de..5e57e78 100644 --- a/chatter/source/input/microsoft.py +++ b/chatter/chatterbot/input/microsoft.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from time import sleep -from . import InputAdapter -from ..conversation import Statement +from chatterbot.input import InputAdapter +from chatterbot.conversation import Statement class Microsoft(InputAdapter): diff --git a/chatter/source/input/terminal.py b/chatter/chatterbot/input/terminal.py similarity index 73% rename from chatter/source/input/terminal.py rename to chatter/chatterbot/input/terminal.py index e2d7ba2..2fc15f2 100644 --- a/chatter/source/input/terminal.py +++ b/chatter/chatterbot/input/terminal.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from . import InputAdapter -from ..conversation import Statement -from ..utils import input_function +from chatterbot.input import InputAdapter +from chatterbot.conversation import Statement +from chatterbot.utils import input_function class TerminalAdapter(InputAdapter): diff --git a/chatter/source/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py similarity index 95% rename from chatter/source/input/variable_input_type_adapter.py rename to chatter/chatterbot/input/variable_input_type_adapter.py index 9158611..2b495d9 100644 --- a/chatter/source/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from . import InputAdapter -from ..conversation import Statement +from chatterbot.input import InputAdapter +from chatterbot.conversation import Statement class VariableInputTypeAdapter(InputAdapter): diff --git a/chatter/source/logic/__init__.py b/chatter/chatterbot/logic/__init__.py similarity index 100% rename from chatter/source/logic/__init__.py rename to chatter/chatterbot/logic/__init__.py diff --git a/chatter/source/logic/best_match.py b/chatter/chatterbot/logic/best_match.py similarity index 100% rename from chatter/source/logic/best_match.py rename to chatter/chatterbot/logic/best_match.py diff --git a/chatter/source/logic/logic_adapter.py b/chatter/chatterbot/logic/logic_adapter.py similarity index 94% rename from chatter/source/logic/logic_adapter.py rename to chatter/chatterbot/logic/logic_adapter.py index df2c143..020c2a2 100644 --- a/chatter/source/logic/logic_adapter.py +++ b/chatter/chatterbot/logic/logic_adapter.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from ..adapters import Adapter -from ..utils import import_module +from chatterbot.adapters import Adapter +from chatterbot.utils import import_module class LogicAdapter(Adapter): @@ -17,8 +17,8 @@ class LogicAdapter(Adapter): def __init__(self, **kwargs): super(LogicAdapter, self).__init__(**kwargs) - from ..comparisons import levenshtein_distance - from ..response_selection import get_first_response + from chatterbot.comparisons import levenshtein_distance + from chatterbot.response_selection import get_first_response # Import string module parameters if 'statement_comparison_function' in kwargs: diff --git a/chatter/source/logic/low_confidence.py b/chatter/chatterbot/logic/low_confidence.py similarity index 97% rename from chatter/source/logic/low_confidence.py rename to chatter/chatterbot/logic/low_confidence.py index fb5435c..bb8ebfd 100644 --- a/chatter/source/logic/low_confidence.py +++ b/chatter/chatterbot/logic/low_confidence.py @@ -1,5 +1,5 @@ from __future__ import unicode_literals -from ..conversation import Statement +from chatterbot.conversation import Statement from .best_match import BestMatch diff --git a/chatter/source/logic/mathematical_evaluation.py b/chatter/chatterbot/logic/mathematical_evaluation.py similarity index 95% rename from chatter/source/logic/mathematical_evaluation.py rename to chatter/chatterbot/logic/mathematical_evaluation.py index 2a65fdc..f1e3cbc 100644 --- a/chatter/source/logic/mathematical_evaluation.py +++ b/chatter/chatterbot/logic/mathematical_evaluation.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from . import LogicAdapter -from ..conversation import Statement +from chatterbot.logic import LogicAdapter +from chatterbot.conversation import Statement class MathematicalEvaluation(LogicAdapter): diff --git a/chatter/source/logic/multi_adapter.py b/chatter/chatterbot/logic/multi_adapter.py similarity index 98% rename from chatter/source/logic/multi_adapter.py rename to chatter/chatterbot/logic/multi_adapter.py index 150f6c3..17e91f4 100644 --- a/chatter/source/logic/multi_adapter.py +++ b/chatter/chatterbot/logic/multi_adapter.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from collections import Counter -from .. import utils +from chatterbot import utils from .logic_adapter import LogicAdapter @@ -13,7 +13,7 @@ class MultiLogicAdapter(LogicAdapter): """ def __init__(self, **kwargs): - super().__init__(**kwargs) + super(MultiLogicAdapter, self).__init__(**kwargs) # Logic adapters added by the chat bot self.adapters = [] diff --git a/chatter/source/logic/no_knowledge_adapter.py b/chatter/chatterbot/logic/no_knowledge_adapter.py similarity index 100% rename from chatter/source/logic/no_knowledge_adapter.py rename to chatter/chatterbot/logic/no_knowledge_adapter.py diff --git a/chatter/source/logic/specific_response.py b/chatter/chatterbot/logic/specific_response.py similarity index 94% rename from chatter/source/logic/specific_response.py rename to chatter/chatterbot/logic/specific_response.py index 2ed6da1..611d54f 100644 --- a/chatter/source/logic/specific_response.py +++ b/chatter/chatterbot/logic/specific_response.py @@ -15,7 +15,7 @@ class SpecificResponseAdapter(LogicAdapter): def __init__(self, **kwargs): super(SpecificResponseAdapter, self).__init__(**kwargs) - from ..conversation import Statement + from chatterbot.conversation import Statement self.input_text = kwargs.get('input_text') diff --git a/chatter/source/logic/time_adapter.py b/chatter/chatterbot/logic/time_adapter.py similarity index 98% rename from chatter/source/logic/time_adapter.py rename to chatter/chatterbot/logic/time_adapter.py index 3de4001..6bf6c73 100644 --- a/chatter/source/logic/time_adapter.py +++ b/chatter/chatterbot/logic/time_adapter.py @@ -79,7 +79,7 @@ class TimeLogicAdapter(LogicAdapter): return features def process(self, statement): - from ..conversation import Statement + from chatterbot.conversation import Statement now = datetime.now() diff --git a/chatter/source/output/__init__.py b/chatter/chatterbot/output/__init__.py similarity index 100% rename from chatter/source/output/__init__.py rename to chatter/chatterbot/output/__init__.py diff --git a/chatter/source/output/gitter.py b/chatter/chatterbot/output/gitter.py similarity index 100% rename from chatter/source/output/gitter.py rename to chatter/chatterbot/output/gitter.py diff --git a/chatter/source/output/hipchat.py b/chatter/chatterbot/output/hipchat.py similarity index 100% rename from chatter/source/output/hipchat.py rename to chatter/chatterbot/output/hipchat.py diff --git a/chatter/source/output/mailgun.py b/chatter/chatterbot/output/mailgun.py similarity index 100% rename from chatter/source/output/mailgun.py rename to chatter/chatterbot/output/mailgun.py diff --git a/chatter/source/output/microsoft.py b/chatter/chatterbot/output/microsoft.py similarity index 100% rename from chatter/source/output/microsoft.py rename to chatter/chatterbot/output/microsoft.py diff --git a/chatter/source/output/output_adapter.py b/chatter/chatterbot/output/output_adapter.py similarity index 93% rename from chatter/source/output/output_adapter.py rename to chatter/chatterbot/output/output_adapter.py index 880cb18..631e343 100644 --- a/chatter/source/output/output_adapter.py +++ b/chatter/chatterbot/output/output_adapter.py @@ -1,4 +1,4 @@ -from ..adapters import Adapter +from chatterbot.adapters import Adapter class OutputAdapter(Adapter): diff --git a/chatter/source/output/terminal.py b/chatter/chatterbot/output/terminal.py similarity index 100% rename from chatter/source/output/terminal.py rename to chatter/chatterbot/output/terminal.py diff --git a/chatter/source/parsing.py b/chatter/chatterbot/parsing.py similarity index 100% rename from chatter/source/parsing.py rename to chatter/chatterbot/parsing.py diff --git a/chatter/source/preprocessors.py b/chatter/chatterbot/preprocessors.py similarity index 100% rename from chatter/source/preprocessors.py rename to chatter/chatterbot/preprocessors.py diff --git a/chatter/source/response_selection.py b/chatter/chatterbot/response_selection.py similarity index 100% rename from chatter/source/response_selection.py rename to chatter/chatterbot/response_selection.py diff --git a/chatter/source/storage/__init__.py b/chatter/chatterbot/storage/__init__.py similarity index 100% rename from chatter/source/storage/__init__.py rename to chatter/chatterbot/storage/__init__.py diff --git a/chatter/source/storage/django_storage.py b/chatter/chatterbot/storage/django_storage.py similarity index 98% rename from chatter/source/storage/django_storage.py rename to chatter/chatterbot/storage/django_storage.py index 5642b2c..dea6a82 100644 --- a/chatter/source/storage/django_storage.py +++ b/chatter/chatterbot/storage/django_storage.py @@ -1,5 +1,5 @@ -from . import StorageAdapter -from .. import constants +from chatterbot.storage import StorageAdapter +from chatterbot import constants class DjangoStorageAdapter(StorageAdapter): diff --git a/chatter/source/storage/mongodb.py b/chatter/chatterbot/storage/mongodb.py similarity index 98% rename from chatter/source/storage/mongodb.py rename to chatter/chatterbot/storage/mongodb.py index 92ce5a1..744d672 100644 --- a/chatter/source/storage/mongodb.py +++ b/chatter/chatterbot/storage/mongodb.py @@ -1,4 +1,4 @@ -from . import StorageAdapter +from chatterbot.storage import StorageAdapter class Query(object): @@ -116,7 +116,7 @@ class MongoDatabaseAdapter(StorageAdapter): """ Return the class for the statement model. """ - from ..conversation import Statement + from chatterbot.conversation import Statement # Create a storage-aware statement statement = Statement @@ -128,7 +128,7 @@ class MongoDatabaseAdapter(StorageAdapter): """ Return the class for the response model. """ - from ..conversation import Response + from chatterbot.conversation import Response # Create a storage-aware response response = Response diff --git a/chatter/source/storage/sql_storage.py b/chatter/chatterbot/storage/sql_storage.py similarity index 96% rename from chatter/source/storage/sql_storage.py rename to chatter/chatterbot/storage/sql_storage.py index 21c84e6..ed1153c 100644 --- a/chatter/source/storage/sql_storage.py +++ b/chatter/chatterbot/storage/sql_storage.py @@ -1,8 +1,8 @@ -from . import StorageAdapter +from chatterbot.storage import StorageAdapter def get_response_table(response): - from ..ext.sqlalchemy_app.models import Response + from chatterbot.ext.sqlalchemy_app.models import Response return Response(text=response.text, occurrence=response.occurrence) @@ -86,28 +86,28 @@ class SQLStorageAdapter(StorageAdapter): """ Return the statement model. """ - from ..ext.sqlalchemy_app.models import Statement + from chatterbot.ext.sqlalchemy_app.models import Statement return Statement def get_response_model(self): """ Return the response model. """ - from ..ext.sqlalchemy_app.models import Response + from chatterbot.ext.sqlalchemy_app.models import Response return Response def get_conversation_model(self): """ Return the conversation model. """ - from ..ext.sqlalchemy_app.models import Conversation + from chatterbot.ext.sqlalchemy_app.models import Conversation return Conversation def get_tag_model(self): """ Return the conversation model. """ - from ..ext.sqlalchemy_app.models import Tag + from chatterbot.ext.sqlalchemy_app.models import Tag return Tag def count(self): @@ -379,14 +379,14 @@ class SQLStorageAdapter(StorageAdapter): """ Drop the database attached to a given adapter. """ - from ..ext.sqlalchemy_app.models import Base + from chatterbot.ext.sqlalchemy_app.models import Base Base.metadata.drop_all(self.engine) def create(self): """ Populate the database with the tables. """ - from ..ext.sqlalchemy_app.models import Base + from chatterbot.ext.sqlalchemy_app.models import Base Base.metadata.create_all(self.engine) def _session_finish(self, session, statement_text=None): diff --git a/chatter/source/storage/storage_adapter.py b/chatter/chatterbot/storage/storage_adapter.py similarity index 100% rename from chatter/source/storage/storage_adapter.py rename to chatter/chatterbot/storage/storage_adapter.py diff --git a/chatter/source/trainers.py b/chatter/chatterbot/trainers.py similarity index 100% rename from chatter/source/trainers.py rename to chatter/chatterbot/trainers.py diff --git a/chatter/source/utils.py b/chatter/chatterbot/utils.py similarity index 100% rename from chatter/source/utils.py rename to chatter/chatterbot/utils.py diff --git a/chatter/source/ext/django_chatterbot/__init__.py b/chatter/source/ext/django_chatterbot/__init__.py deleted file mode 100644 index c683f59..0000000 --- a/chatter/source/ext/django_chatterbot/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -default_app_config = ( - 'chatter.source.ext.django_chatterbot.apps.DjangoChatterBotConfig' -) From d7b91c4f4f695b8b46f15b5d9bf233097985d45e Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:01:03 -0400 Subject: [PATCH 05/50] chatter --- chatter/chatterbot/storage/django_storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chatter/chatterbot/storage/django_storage.py b/chatter/chatterbot/storage/django_storage.py index dea6a82..5e11fc6 100644 --- a/chatter/chatterbot/storage/django_storage.py +++ b/chatter/chatterbot/storage/django_storage.py @@ -1,5 +1,5 @@ -from chatterbot.storage import StorageAdapter -from chatterbot import constants +from chatter.chatterbot.storage import StorageAdapter +from chatter.chatterbot import constants class DjangoStorageAdapter(StorageAdapter): From bb6a336e0e11be2756fa3a98d3e719a5bc87b7cc Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:12:58 -0400 Subject: [PATCH 06/50] no djnago --- chatter/chatterbot/chatterbot.py | 6 +- .../ext/django_chatterbot/__init__.py | 3 - .../ext/django_chatterbot/abstract_models.py | 261 ------------------ .../chatterbot/ext/django_chatterbot/admin.py | 31 --- .../chatterbot/ext/django_chatterbot/apps.py | 8 - .../ext/django_chatterbot/factories.py | 42 --- .../django_chatterbot/management/__init__.py | 0 .../management/commands/__init__.py | 0 .../management/commands/train.py | 29 -- .../migrations/0001_initial.py | 39 --- .../migrations/0002_statement_extra_data.py | 21 -- .../0003_change_occurrence_default.py | 20 -- .../migrations/0004_rename_in_response_to.py | 26 -- .../migrations/0005_statement_created_at.py | 24 -- .../migrations/0006_create_conversation.py | 33 --- .../migrations/0007_response_created_at.py | 24 -- .../migrations/0008_update_conversations.py | 32 --- .../django_chatterbot/migrations/0009_tags.py | 35 --- .../migrations/0010_statement_text.py | 20 -- .../migrations/0011_blank_extra_data.py | 20 -- .../django_chatterbot/migrations/__init__.py | 0 .../ext/django_chatterbot/models.py | 34 --- .../ext/django_chatterbot/settings.py | 19 -- .../chatterbot/ext/django_chatterbot/urls.py | 11 - .../chatterbot/ext/django_chatterbot/views.py | 118 -------- .../chatterbot/ext/sqlalchemy_app/models.py | 9 +- chatter/chatterbot/input/__init__.py | 5 +- chatter/chatterbot/input/gitter.py | 4 +- chatter/chatterbot/input/hipchat.py | 4 +- chatter/chatterbot/input/input_adapter.py | 1 + chatter/chatterbot/input/mailgun.py | 4 +- chatter/chatterbot/input/microsoft.py | 4 +- chatter/chatterbot/input/terminal.py | 3 +- .../input/variable_input_type_adapter.py | 3 +- chatter/chatterbot/logic/__init__.py | 3 +- chatter/chatterbot/logic/best_match.py | 1 + chatter/chatterbot/logic/logic_adapter.py | 1 + chatter/chatterbot/logic/low_confidence.py | 2 + .../logic/mathematical_evaluation.py | 3 +- chatter/chatterbot/logic/multi_adapter.py | 3 + .../chatterbot/logic/no_knowledge_adapter.py | 1 + chatter/chatterbot/logic/specific_response.py | 1 + chatter/chatterbot/logic/time_adapter.py | 2 + chatter/chatterbot/output/__init__.py | 8 +- chatter/chatterbot/output/gitter.py | 1 + chatter/chatterbot/output/hipchat.py | 2 + chatter/chatterbot/output/mailgun.py | 1 + chatter/chatterbot/output/microsoft.py | 2 + chatter/chatterbot/output/terminal.py | 1 + chatter/chatterbot/parsing.py | 2 +- chatter/chatterbot/storage/__init__.py | 5 +- chatter/chatterbot/storage/django_storage.py | 220 --------------- chatter/chatterbot/trainers.py | 3 +- 53 files changed, 56 insertions(+), 1099 deletions(-) delete mode 100644 chatter/chatterbot/ext/django_chatterbot/__init__.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/abstract_models.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/admin.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/apps.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/factories.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/management/__init__.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/management/commands/__init__.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/management/commands/train.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0001_initial.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0009_tags.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/migrations/__init__.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/models.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/settings.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/urls.py delete mode 100644 chatter/chatterbot/ext/django_chatterbot/views.py delete mode 100644 chatter/chatterbot/storage/django_storage.py diff --git a/chatter/chatterbot/chatterbot.py b/chatter/chatterbot/chatterbot.py index 2a5049d..40fd05d 100644 --- a/chatter/chatterbot/chatterbot.py +++ b/chatter/chatterbot/chatterbot.py @@ -1,9 +1,11 @@ from __future__ import unicode_literals + import logging -from .storage import StorageAdapter + +from . import utils from .input import InputAdapter from .output import OutputAdapter -from . import utils +from .storage import StorageAdapter class ChatBot(object): diff --git a/chatter/chatterbot/ext/django_chatterbot/__init__.py b/chatter/chatterbot/ext/django_chatterbot/__init__.py deleted file mode 100644 index 0bd8684..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -default_app_config = ( - 'chatterbot.ext.django_chatterbot.apps.DjangoChatterBotConfig' -) diff --git a/chatter/chatterbot/ext/django_chatterbot/abstract_models.py b/chatter/chatterbot/ext/django_chatterbot/abstract_models.py deleted file mode 100644 index 59c9cea..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/abstract_models.py +++ /dev/null @@ -1,261 +0,0 @@ -from chatterbot.conversation import StatementMixin -from chatterbot import constants -from django.db import models -from django.apps import apps -from django.utils import timezone -from django.conf import settings - - -DJANGO_APP_NAME = constants.DEFAULT_DJANGO_APP_NAME -STATEMENT_MODEL = 'Statement' -RESPONSE_MODEL = 'Response' - -if hasattr(settings, 'CHATTERBOT'): - """ - Allow related models to be overridden in the project settings. - Default to the original settings if one is not defined. - """ - DJANGO_APP_NAME = settings.CHATTERBOT.get( - 'django_app_name', - DJANGO_APP_NAME - ) - STATEMENT_MODEL = settings.CHATTERBOT.get( - 'statement_model', - STATEMENT_MODEL - ) - RESPONSE_MODEL = settings.CHATTERBOT.get( - 'response_model', - RESPONSE_MODEL - ) - - -class AbstractBaseStatement(models.Model, StatementMixin): - """ - The abstract base statement allows other models to - be created using the attributes that exist on the - default models. - """ - - text = models.CharField( - unique=True, - blank=False, - null=False, - max_length=constants.STATEMENT_TEXT_MAX_LENGTH - ) - - extra_data = models.CharField( - max_length=500, - blank=True - ) - - # This is the confidence with which the chat bot believes - # this is an accurate response. This value is set when the - # statement is returned by the chat bot. - confidence = 0 - - class Meta: - abstract = True - - def __str__(self): - if len(self.text.strip()) > 60: - return '{}...'.format(self.text[:57]) - elif len(self.text.strip()) > 0: - return self.text - return '' - - def __init__(self, *args, **kwargs): - super(AbstractBaseStatement, self).__init__(*args, **kwargs) - - # Responses to be saved if the statement is updated with the storage adapter - self.response_statement_cache = [] - - @property - def in_response_to(self): - """ - Return the response objects that are for this statement. - """ - ResponseModel = apps.get_model(DJANGO_APP_NAME, RESPONSE_MODEL) - return ResponseModel.objects.filter(statement=self) - - def add_extra_data(self, key, value): - """ - Add extra data to the extra_data field. - """ - import json - - if not self.extra_data: - self.extra_data = '{}' - - extra_data = json.loads(self.extra_data) - extra_data[key] = value - - self.extra_data = json.dumps(extra_data) - - def add_tags(self, tags): - """ - Add a list of strings to the statement as tags. - (Overrides the method from StatementMixin) - """ - for tag in tags: - self.tags.create( - name=tag - ) - - def add_response(self, statement): - """ - Add a response to this statement. - """ - self.response_statement_cache.append(statement) - - def remove_response(self, response_text): - """ - Removes a response from the statement's response list based - on the value of the response text. - - :param response_text: The text of the response to be removed. - :type response_text: str - """ - is_deleted = False - response = self.in_response.filter(response__text=response_text) - - if response.exists(): - is_deleted = True - - return is_deleted - - def get_response_count(self, statement): - """ - Find the number of times that the statement has been used - as a response to the current statement. - - :param statement: The statement object to get the count for. - :type statement: chatterbot.conversation.Statement - - :returns: Return the number of times the statement has been used as a response. - :rtype: int - """ - return self.in_response.filter(response__text=statement.text).count() - - def serialize(self): - """ - :returns: A dictionary representation of the statement object. - :rtype: dict - """ - import json - data = {} - - if not self.extra_data: - self.extra_data = '{}' - - data['text'] = self.text - data['in_response_to'] = [] - data['extra_data'] = json.loads(self.extra_data) - - for response in self.in_response.all(): - data['in_response_to'].append(response.serialize()) - - return data - - -class AbstractBaseResponse(models.Model): - """ - The abstract base response allows other models to - be created using the attributes that exist on the - default models. - """ - - statement = models.ForeignKey( - STATEMENT_MODEL, - related_name='in_response', - on_delete=models.CASCADE - ) - - response = models.ForeignKey( - STATEMENT_MODEL, - related_name='responses', - on_delete=models.CASCADE - ) - - created_at = models.DateTimeField( - default=timezone.now, - help_text='The date and time that this response was created at.' - ) - - class Meta: - abstract = True - - @property - def occurrence(self): - """ - Return a count of the number of times this response has occurred. - """ - ResponseModel = apps.get_model(DJANGO_APP_NAME, RESPONSE_MODEL) - - return ResponseModel.objects.filter( - statement__text=self.statement.text, - response__text=self.response.text - ).count() - - def __str__(self): - statement = self.statement.text - response = self.response.text - return '{} => {}'.format( - statement if len(statement) <= 20 else statement[:17] + '...', - response if len(response) <= 40 else response[:37] + '...' - ) - - def serialize(self): - """ - :returns: A dictionary representation of the statement object. - :rtype: dict - """ - data = {} - - data['text'] = self.response.text - data['created_at'] = self.created_at.isoformat() - data['occurrence'] = self.occurrence - - return data - - -class AbstractBaseConversation(models.Model): - """ - The abstract base conversation allows other models to - be created using the attributes that exist on the - default models. - """ - - responses = models.ManyToManyField( - RESPONSE_MODEL, - related_name='conversations', - help_text='The responses in this conversation.' - ) - - class Meta: - abstract = True - - def __str__(self): - return str(self.id) - - -class AbstractBaseTag(models.Model): - """ - The abstract base tag allows other models to - be created using the attributes that exist on the - default models. - """ - - name = models.SlugField( - max_length=constants.TAG_NAME_MAX_LENGTH - ) - - statements = models.ManyToManyField( - STATEMENT_MODEL, - related_name='tags' - ) - - class Meta: - abstract = True - - def __str__(self): - return self.name diff --git a/chatter/chatterbot/ext/django_chatterbot/admin.py b/chatter/chatterbot/ext/django_chatterbot/admin.py deleted file mode 100644 index a641883..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/admin.py +++ /dev/null @@ -1,31 +0,0 @@ -from django.contrib import admin -from chatterbot.ext.django_chatterbot.models import ( - Statement, Response, Conversation, Tag -) - - -class StatementAdmin(admin.ModelAdmin): - list_display = ('text', ) - list_filter = ('text', ) - search_fields = ('text', ) - - -class ResponseAdmin(admin.ModelAdmin): - list_display = ('statement', 'response', 'occurrence', ) - search_fields = ['statement__text', 'response__text'] - - -class ConversationAdmin(admin.ModelAdmin): - list_display = ('id', ) - - -class TagAdmin(admin.ModelAdmin): - list_display = ('name', ) - list_filter = ('name', ) - search_fields = ('name', ) - - -admin.site.register(Statement, StatementAdmin) -admin.site.register(Response, ResponseAdmin) -admin.site.register(Conversation, ConversationAdmin) -admin.site.register(Tag, TagAdmin) diff --git a/chatter/chatterbot/ext/django_chatterbot/apps.py b/chatter/chatterbot/ext/django_chatterbot/apps.py deleted file mode 100644 index 13f8fe0..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/apps.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.apps import AppConfig - - -class DjangoChatterBotConfig(AppConfig): - - name = 'chatterbot.ext.django_chatterbot' - label = 'django_chatterbot' - verbose_name = 'Django ChatterBot' diff --git a/chatter/chatterbot/ext/django_chatterbot/factories.py b/chatter/chatterbot/ext/django_chatterbot/factories.py deleted file mode 100644 index 4ac52b8..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/factories.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -These factories are used to generate fake data for testing. -""" -import factory -from chatterbot.ext.django_chatterbot import models -from chatterbot import constants -from factory.django import DjangoModelFactory - - -class StatementFactory(DjangoModelFactory): - - text = factory.Faker( - 'text', - max_nb_chars=constants.STATEMENT_TEXT_MAX_LENGTH - ) - - class Meta: - model = models.Statement - - -class ResponseFactory(DjangoModelFactory): - - statement = factory.SubFactory(StatementFactory) - - response = factory.SubFactory(StatementFactory) - - class Meta: - model = models.Response - - -class ConversationFactory(DjangoModelFactory): - - class Meta: - model = models.Conversation - - -class TagFactory(DjangoModelFactory): - - name = factory.Faker('word') - - class Meta: - model = models.Tag diff --git a/chatter/chatterbot/ext/django_chatterbot/management/__init__.py b/chatter/chatterbot/ext/django_chatterbot/management/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/chatter/chatterbot/ext/django_chatterbot/management/commands/__init__.py b/chatter/chatterbot/ext/django_chatterbot/management/commands/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/chatter/chatterbot/ext/django_chatterbot/management/commands/train.py b/chatter/chatterbot/ext/django_chatterbot/management/commands/train.py deleted file mode 100644 index 50af70d..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/management/commands/train.py +++ /dev/null @@ -1,29 +0,0 @@ -from django.core.management.base import BaseCommand - - -class Command(BaseCommand): - """ - A Django management command for calling a - chat bot's training method. - """ - - help = 'Trains the database used by the chat bot' - can_import_settings = True - - def handle(self, *args, **options): - from chatterbot import ChatBot - from chatterbot.ext.django_chatterbot import settings - - chatterbot = ChatBot(**settings.CHATTERBOT) - - chatterbot.train(chatterbot.training_data) - - # Django 1.8 does not define SUCCESS - if hasattr(self.style, 'SUCCESS'): - style = self.style.SUCCESS - else: - style = self.style.NOTICE - - self.stdout.write(style('Starting training...')) - training_class = chatterbot.trainer.__class__.__name__ - self.stdout.write(style('ChatterBot trained using "%s"' % training_class)) diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0001_initial.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0001_initial.py deleted file mode 100644 index 9c20907..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0001_initial.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [] - - operations = [ - migrations.CreateModel( - name='Response', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('occurrence', models.PositiveIntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='Statement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('text', models.CharField(max_length=255, unique=True)), - ], - ), - migrations.AddField( - model_name='response', - name='response', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='django_chatterbot.Statement'), - ), - migrations.AddField( - model_name='response', - name='statement', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='in_response_to', to='django_chatterbot.Statement'), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py deleted file mode 100644 index 5ed2f4a..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.2 on 2016-10-30 12:13 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='statement', - name='extra_data', - field=models.CharField(default='{}', max_length=500), - preserve_default=False, - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py deleted file mode 100644 index 8da6869..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-12-12 00:06 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0002_statement_extra_data'), - ] - - operations = [ - migrations.AlterField( - model_name='response', - name='occurrence', - field=models.PositiveIntegerField(default=1), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py deleted file mode 100644 index 7860d49..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.3 on 2016-12-04 23:52 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0003_change_occurrence_default'), - ] - - operations = [ - migrations.AlterField( - model_name='response', - name='statement', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='in_response', to='django_chatterbot.Statement'), - ), - migrations.AlterField( - model_name='response', - name='response', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='responses', to='django_chatterbot.Statement'), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py deleted file mode 100644 index 7b38f00..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.1 on 2016-12-29 19:20 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.utils.timezone - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0004_rename_in_response_to'), - ] - - operations = [ - migrations.AddField( - model_name='statement', - name='created_at', - field=models.DateTimeField( - default=django.utils.timezone.now, - help_text='The date and time that this statement was created at.' - ), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py deleted file mode 100644 index 1cf95d9..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2017-01-17 07:02 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0005_statement_created_at'), - ] - - operations = [ - migrations.CreateModel( - name='Conversation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ], - ), - migrations.AlterField( - model_name='statement', - name='created_at', - field=models.DateTimeField(default=django.utils.timezone.now, help_text='The date and time that this statement was created at.'), - ), - migrations.AddField( - model_name='conversation', - name='statements', - field=models.ManyToManyField(help_text='The statements in this conversation.', related_name='conversation', to='django_chatterbot.Statement'), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py deleted file mode 100644 index 1a0b5ac..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-07-18 00:16 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.utils.timezone - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0006_create_conversation'), - ] - - operations = [ - migrations.AddField( - model_name='response', - name='created_at', - field=models.DateTimeField( - default=django.utils.timezone.now, - help_text='The date and time that this response was created at.' - ), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py deleted file mode 100644 index f3bd720..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-07-18 11:25 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0007_response_created_at'), - ] - - operations = [ - migrations.RemoveField( - model_name='conversation', - name='statements', - ), - migrations.RemoveField( - model_name='response', - name='occurrence', - ), - migrations.RemoveField( - model_name='statement', - name='created_at', - ), - migrations.AddField( - model_name='conversation', - name='responses', - field=models.ManyToManyField(help_text='The responses in this conversation.', related_name='conversations', to='django_chatterbot.Response'), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0009_tags.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0009_tags.py deleted file mode 100644 index ee71713..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0009_tags.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11a1 on 2017-07-07 00:12 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0008_update_conversations'), - ] - - operations = [ - migrations.CreateModel( - name='Tag', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.SlugField()), - ], - options={ - 'abstract': False, - }, - ), - migrations.AlterField( - model_name='statement', - name='text', - field=models.CharField(max_length=255, unique=True), - ), - migrations.AddField( - model_name='tag', - name='statements', - field=models.ManyToManyField(related_name='tags', to='django_chatterbot.Statement'), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py deleted file mode 100644 index 84940a7..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.4 on 2017-08-16 00:56 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0009_tags'), - ] - - operations = [ - migrations.AlterField( - model_name='statement', - name='text', - field=models.CharField(max_length=400, unique=True), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py b/chatter/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py deleted file mode 100644 index 4f7b327..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.4 on 2017-08-20 13:55 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('django_chatterbot', '0010_statement_text'), - ] - - operations = [ - migrations.AlterField( - model_name='statement', - name='extra_data', - field=models.CharField(blank=True, max_length=500), - ), - ] diff --git a/chatter/chatterbot/ext/django_chatterbot/migrations/__init__.py b/chatter/chatterbot/ext/django_chatterbot/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/chatter/chatterbot/ext/django_chatterbot/models.py b/chatter/chatterbot/ext/django_chatterbot/models.py deleted file mode 100644 index d82a603..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/models.py +++ /dev/null @@ -1,34 +0,0 @@ -from chatterbot.ext.django_chatterbot.abstract_models import ( - AbstractBaseConversation, AbstractBaseResponse, - AbstractBaseStatement, AbstractBaseTag -) - - -class Statement(AbstractBaseStatement): - """ - A statement represents a single spoken entity, sentence or - phrase that someone can say. - """ - pass - - -class Response(AbstractBaseResponse): - """ - A connection between a statement and anther statement - that response to it. - """ - pass - - -class Conversation(AbstractBaseConversation): - """ - A sequence of statements representing a conversation. - """ - pass - - -class Tag(AbstractBaseTag): - """ - A label that categorizes a statement. - """ - pass diff --git a/chatter/chatterbot/ext/django_chatterbot/settings.py b/chatter/chatterbot/ext/django_chatterbot/settings.py deleted file mode 100644 index ed5ca46..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/settings.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -Default ChatterBot settings for Django. -""" -from django.conf import settings -from chatterbot import constants - - -CHATTERBOT_SETTINGS = getattr(settings, 'CHATTERBOT', {}) - -CHATTERBOT_DEFAULTS = { - 'name': 'ChatterBot', - 'storage_adapter': 'chatterbot.storage.DjangoStorageAdapter', - 'input_adapter': 'chatterbot.input.VariableInputTypeAdapter', - 'output_adapter': 'chatterbot.output.OutputAdapter', - 'django_app_name': constants.DEFAULT_DJANGO_APP_NAME -} - -CHATTERBOT = CHATTERBOT_DEFAULTS.copy() -CHATTERBOT.update(CHATTERBOT_SETTINGS) diff --git a/chatter/chatterbot/ext/django_chatterbot/urls.py b/chatter/chatterbot/ext/django_chatterbot/urls.py deleted file mode 100644 index 079005d..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/urls.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.conf.urls import url -from .views import ChatterBotView - - -urlpatterns = [ - url( - r'^$', - ChatterBotView.as_view(), - name='chatterbot', - ), -] diff --git a/chatter/chatterbot/ext/django_chatterbot/views.py b/chatter/chatterbot/ext/django_chatterbot/views.py deleted file mode 100644 index ff4d12b..0000000 --- a/chatter/chatterbot/ext/django_chatterbot/views.py +++ /dev/null @@ -1,118 +0,0 @@ -import json -from django.views.generic import View -from django.http import JsonResponse -from chatterbot import ChatBot -from chatterbot.ext.django_chatterbot import settings - - -class ChatterBotViewMixin(object): - """ - Subclass this mixin for access to the 'chatterbot' attribute. - """ - - chatterbot = ChatBot(**settings.CHATTERBOT) - - def validate(self, data): - """ - Validate the data recieved from the client. - - * The data should contain a text attribute. - """ - from django.core.exceptions import ValidationError - - if 'text' not in data: - raise ValidationError('The attribute "text" is required.') - - def get_conversation(self, request): - """ - Return the conversation for the session if one exists. - Create a new conversation if one does not exist. - """ - from chatterbot.ext.django_chatterbot.models import Conversation, Response - - class Obj(object): - def __init__(self): - self.id = None - self.statements = [] - - conversation = Obj() - - conversation.id = request.session.get('conversation_id', 0) - existing_conversation = False - try: - Conversation.objects.get(id=conversation.id) - existing_conversation = True - - except Conversation.DoesNotExist: - conversation_id = self.chatterbot.storage.create_conversation() - request.session['conversation_id'] = conversation_id - conversation.id = conversation_id - - if existing_conversation: - responses = Response.objects.filter( - conversations__id=conversation.id - ) - - for response in responses: - conversation.statements.append(response.statement.serialize()) - conversation.statements.append(response.response.serialize()) - - return conversation - - -class ChatterBotView(ChatterBotViewMixin, View): - """ - Provide an API endpoint to interact with ChatterBot. - """ - - def post(self, request, *args, **kwargs): - """ - Return a response to the statement in the posted data. - """ - input_data = json.loads(request.read().decode('utf-8')) - - self.validate(input_data) - - conversation = self.get_conversation(request) - - response = self.chatterbot.get_response(input_data, conversation.id) - response_data = response.serialize() - - return JsonResponse(response_data, status=200) - - def get(self, request, *args, **kwargs): - """ - Return data corresponding to the current conversation. - """ - conversation = self.get_conversation(request) - - data = { - 'detail': 'You should make a POST request to this endpoint.', - 'name': self.chatterbot.name, - 'conversation': conversation.statements - } - - # Return a method not allowed response - return JsonResponse(data, status=405) - - def patch(self, request, *args, **kwargs): - """ - The patch method is not allowed for this endpoint. - """ - data = { - 'detail': 'You should make a POST request to this endpoint.' - } - - # Return a method not allowed response - return JsonResponse(data, status=405) - - def delete(self, request, *args, **kwargs): - """ - The delete method is not allowed for this endpoint. - """ - data = { - 'detail': 'You should make a POST request to this endpoint.' - } - - # Return a method not allowed response - return JsonResponse(data, status=405) diff --git a/chatter/chatterbot/ext/sqlalchemy_app/models.py b/chatter/chatterbot/ext/sqlalchemy_app/models.py index cba4a47..ae08193 100644 --- a/chatter/chatterbot/ext/sqlalchemy_app/models.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/models.py @@ -1,11 +1,10 @@ +from chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH +from chatterbot.conversation import StatementMixin +from chatterbot.ext.sqlalchemy_app.types import UnicodeString from sqlalchemy import Table, Column, Integer, DateTime, ForeignKey, PickleType +from sqlalchemy.ext.declarative import declared_attr, declarative_base from sqlalchemy.orm import relationship from sqlalchemy.sql import func -from sqlalchemy.ext.declarative import declared_attr, declarative_base - -from chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH -from chatterbot.ext.sqlalchemy_app.types import UnicodeString -from chatterbot.conversation import StatementMixin class ModelBase(object): diff --git a/chatter/chatterbot/input/__init__.py b/chatter/chatterbot/input/__init__.py index 34d9568..625b583 100644 --- a/chatter/chatterbot/input/__init__.py +++ b/chatter/chatterbot/input/__init__.py @@ -1,12 +1,11 @@ -from .input_adapter import InputAdapter -from .microsoft import Microsoft from .gitter import Gitter from .hipchat import HipChat +from .input_adapter import InputAdapter from .mailgun import Mailgun +from .microsoft import Microsoft from .terminal import TerminalAdapter from .variable_input_type_adapter import VariableInputTypeAdapter - __all__ = ( 'InputAdapter', 'Microsoft', diff --git a/chatter/chatterbot/input/gitter.py b/chatter/chatterbot/input/gitter.py index db97772..1b6d01f 100644 --- a/chatter/chatterbot/input/gitter.py +++ b/chatter/chatterbot/input/gitter.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + from time import sleep -from chatterbot.input import InputAdapter + from chatterbot.conversation import Statement +from chatterbot.input import InputAdapter class Gitter(InputAdapter): diff --git a/chatter/chatterbot/input/hipchat.py b/chatter/chatterbot/input/hipchat.py index 57cf4d6..70c52bc 100644 --- a/chatter/chatterbot/input/hipchat.py +++ b/chatter/chatterbot/input/hipchat.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + from time import sleep -from chatterbot.input import InputAdapter + from chatterbot.conversation import Statement +from chatterbot.input import InputAdapter class HipChat(InputAdapter): diff --git a/chatter/chatterbot/input/input_adapter.py b/chatter/chatterbot/input/input_adapter.py index 17b1dbe..46fb3a5 100644 --- a/chatter/chatterbot/input/input_adapter.py +++ b/chatter/chatterbot/input/input_adapter.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from chatterbot.adapters import Adapter diff --git a/chatter/chatterbot/input/mailgun.py b/chatter/chatterbot/input/mailgun.py index 199a677..9807a79 100644 --- a/chatter/chatterbot/input/mailgun.py +++ b/chatter/chatterbot/input/mailgun.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import datetime -from chatterbot.input import InputAdapter + from chatterbot.conversation import Statement +from chatterbot.input import InputAdapter class Mailgun(InputAdapter): diff --git a/chatter/chatterbot/input/microsoft.py b/chatter/chatterbot/input/microsoft.py index 5e57e78..3d58dd8 100644 --- a/chatter/chatterbot/input/microsoft.py +++ b/chatter/chatterbot/input/microsoft.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + from time import sleep -from chatterbot.input import InputAdapter + from chatterbot.conversation import Statement +from chatterbot.input import InputAdapter class Microsoft(InputAdapter): diff --git a/chatter/chatterbot/input/terminal.py b/chatter/chatterbot/input/terminal.py index 2fc15f2..40521d2 100644 --- a/chatter/chatterbot/input/terminal.py +++ b/chatter/chatterbot/input/terminal.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals -from chatterbot.input import InputAdapter + from chatterbot.conversation import Statement +from chatterbot.input import InputAdapter from chatterbot.utils import input_function diff --git a/chatter/chatterbot/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py index 2b495d9..c0bd8cb 100644 --- a/chatter/chatterbot/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals -from chatterbot.input import InputAdapter + from chatterbot.conversation import Statement +from chatterbot.input import InputAdapter class VariableInputTypeAdapter(InputAdapter): diff --git a/chatter/chatterbot/logic/__init__.py b/chatter/chatterbot/logic/__init__.py index ecb1020..1930556 100644 --- a/chatter/chatterbot/logic/__init__.py +++ b/chatter/chatterbot/logic/__init__.py @@ -1,5 +1,5 @@ -from .logic_adapter import LogicAdapter from .best_match import BestMatch +from .logic_adapter import LogicAdapter from .low_confidence import LowConfidenceAdapter from .mathematical_evaluation import MathematicalEvaluation from .multi_adapter import MultiLogicAdapter @@ -7,7 +7,6 @@ from .no_knowledge_adapter import NoKnowledgeAdapter from .specific_response import SpecificResponseAdapter from .time_adapter import TimeLogicAdapter - __all__ = ( 'LogicAdapter', 'BestMatch', diff --git a/chatter/chatterbot/logic/best_match.py b/chatter/chatterbot/logic/best_match.py index 712c8f9..5c48121 100644 --- a/chatter/chatterbot/logic/best_match.py +++ b/chatter/chatterbot/logic/best_match.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/logic/logic_adapter.py b/chatter/chatterbot/logic/logic_adapter.py index 020c2a2..68f8088 100644 --- a/chatter/chatterbot/logic/logic_adapter.py +++ b/chatter/chatterbot/logic/logic_adapter.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from chatterbot.adapters import Adapter from chatterbot.utils import import_module diff --git a/chatter/chatterbot/logic/low_confidence.py b/chatter/chatterbot/logic/low_confidence.py index bb8ebfd..2e9dd65 100644 --- a/chatter/chatterbot/logic/low_confidence.py +++ b/chatter/chatterbot/logic/low_confidence.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals + from chatterbot.conversation import Statement + from .best_match import BestMatch diff --git a/chatter/chatterbot/logic/mathematical_evaluation.py b/chatter/chatterbot/logic/mathematical_evaluation.py index f1e3cbc..02af55e 100644 --- a/chatter/chatterbot/logic/mathematical_evaluation.py +++ b/chatter/chatterbot/logic/mathematical_evaluation.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals -from chatterbot.logic import LogicAdapter + from chatterbot.conversation import Statement +from chatterbot.logic import LogicAdapter class MathematicalEvaluation(LogicAdapter): diff --git a/chatter/chatterbot/logic/multi_adapter.py b/chatter/chatterbot/logic/multi_adapter.py index 17e91f4..145424a 100644 --- a/chatter/chatterbot/logic/multi_adapter.py +++ b/chatter/chatterbot/logic/multi_adapter.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals + from collections import Counter + from chatterbot import utils + from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/logic/no_knowledge_adapter.py b/chatter/chatterbot/logic/no_knowledge_adapter.py index 59b11fd..55208b4 100644 --- a/chatter/chatterbot/logic/no_knowledge_adapter.py +++ b/chatter/chatterbot/logic/no_knowledge_adapter.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/logic/specific_response.py b/chatter/chatterbot/logic/specific_response.py index 611d54f..d3fa38a 100644 --- a/chatter/chatterbot/logic/specific_response.py +++ b/chatter/chatterbot/logic/specific_response.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/logic/time_adapter.py b/chatter/chatterbot/logic/time_adapter.py index 6bf6c73..5047210 100644 --- a/chatter/chatterbot/logic/time_adapter.py +++ b/chatter/chatterbot/logic/time_adapter.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals + from datetime import datetime + from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/output/__init__.py b/chatter/chatterbot/output/__init__.py index 0d64ca4..80abe4f 100644 --- a/chatter/chatterbot/output/__init__.py +++ b/chatter/chatterbot/output/__init__.py @@ -1,9 +1,9 @@ -from .output_adapter import OutputAdapter -from .microsoft import Microsoft -from .terminal import TerminalAdapter -from .mailgun import Mailgun from .gitter import Gitter from .hipchat import HipChat +from .mailgun import Mailgun +from .microsoft import Microsoft +from .output_adapter import OutputAdapter +from .terminal import TerminalAdapter __all__ = ( 'OutputAdapter', diff --git a/chatter/chatterbot/output/gitter.py b/chatter/chatterbot/output/gitter.py index db654e2..ba01fa8 100644 --- a/chatter/chatterbot/output/gitter.py +++ b/chatter/chatterbot/output/gitter.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .output_adapter import OutputAdapter diff --git a/chatter/chatterbot/output/hipchat.py b/chatter/chatterbot/output/hipchat.py index 4eaa9a7..2546092 100644 --- a/chatter/chatterbot/output/hipchat.py +++ b/chatter/chatterbot/output/hipchat.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals + import json + from .output_adapter import OutputAdapter diff --git a/chatter/chatterbot/output/mailgun.py b/chatter/chatterbot/output/mailgun.py index 6bb4954..71a9a7a 100644 --- a/chatter/chatterbot/output/mailgun.py +++ b/chatter/chatterbot/output/mailgun.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .output_adapter import OutputAdapter diff --git a/chatter/chatterbot/output/microsoft.py b/chatter/chatterbot/output/microsoft.py index 177dc35..816fc97 100644 --- a/chatter/chatterbot/output/microsoft.py +++ b/chatter/chatterbot/output/microsoft.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals + import json + from .output_adapter import OutputAdapter diff --git a/chatter/chatterbot/output/terminal.py b/chatter/chatterbot/output/terminal.py index f189aba..8ab63e1 100644 --- a/chatter/chatterbot/output/terminal.py +++ b/chatter/chatterbot/output/terminal.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from .output_adapter import OutputAdapter diff --git a/chatter/chatterbot/parsing.py b/chatter/chatterbot/parsing.py index cf955ff..d7ad4d2 100644 --- a/chatter/chatterbot/parsing.py +++ b/chatter/chatterbot/parsing.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- +import calendar import re from datetime import timedelta, datetime -import calendar # Variations of dates that the parser can capture year_variations = ['year', 'years', 'yrs'] diff --git a/chatter/chatterbot/storage/__init__.py b/chatter/chatterbot/storage/__init__.py index 2b4e286..c456292 100644 --- a/chatter/chatterbot/storage/__init__.py +++ b/chatter/chatterbot/storage/__init__.py @@ -1,12 +1,9 @@ -from .storage_adapter import StorageAdapter -from .django_storage import DjangoStorageAdapter from .mongodb import MongoDatabaseAdapter from .sql_storage import SQLStorageAdapter - +from .storage_adapter import StorageAdapter __all__ = ( 'StorageAdapter', - 'DjangoStorageAdapter', 'MongoDatabaseAdapter', 'SQLStorageAdapter', ) diff --git a/chatter/chatterbot/storage/django_storage.py b/chatter/chatterbot/storage/django_storage.py deleted file mode 100644 index 5e11fc6..0000000 --- a/chatter/chatterbot/storage/django_storage.py +++ /dev/null @@ -1,220 +0,0 @@ -from chatter.chatterbot.storage import StorageAdapter -from chatter.chatterbot import constants - - -class DjangoStorageAdapter(StorageAdapter): - """ - Storage adapter that allows ChatterBot to interact with - Django storage backends. - """ - - def __init__(self, **kwargs): - super(DjangoStorageAdapter, self).__init__(**kwargs) - - self.adapter_supports_queries = False - self.django_app_name = kwargs.get( - 'django_app_name', - constants.DEFAULT_DJANGO_APP_NAME - ) - - def get_statement_model(self): - from django.apps import apps - return apps.get_model(self.django_app_name, 'Statement') - - def get_response_model(self): - from django.apps import apps - return apps.get_model(self.django_app_name, 'Response') - - def get_conversation_model(self): - from django.apps import apps - return apps.get_model(self.django_app_name, 'Conversation') - - def get_tag_model(self): - from django.apps import apps - return apps.get_model(self.django_app_name, 'Tag') - - def count(self): - Statement = self.get_model('statement') - return Statement.objects.count() - - def find(self, statement_text): - Statement = self.get_model('statement') - try: - return Statement.objects.get(text=statement_text) - except Statement.DoesNotExist as e: - self.logger.info(str(e)) - return None - - def filter(self, **kwargs): - """ - Returns a list of statements in the database - that match the parameters specified. - """ - from django.db.models import Q - Statement = self.get_model('statement') - - order = kwargs.pop('order_by', None) - - RESPONSE_CONTAINS = 'in_response_to__contains' - - if RESPONSE_CONTAINS in kwargs: - value = kwargs[RESPONSE_CONTAINS] - del kwargs[RESPONSE_CONTAINS] - kwargs['in_response__response__text'] = value - - kwargs_copy = kwargs.copy() - - for kwarg in kwargs_copy: - value = kwargs[kwarg] - del kwargs[kwarg] - kwarg = kwarg.replace('in_response_to', 'in_response') - kwargs[kwarg] = value - - if 'in_response' in kwargs: - responses = kwargs['in_response'] - del kwargs['in_response'] - - if responses: - kwargs['in_response__response__text__in'] = [] - for response in responses: - kwargs['in_response__response__text__in'].append(response) - else: - kwargs['in_response'] = None - - parameters = {} - if 'in_response__response__text' in kwargs: - value = kwargs['in_response__response__text'] - parameters['responses__statement__text'] = value - - statements = Statement.objects.filter(Q(**kwargs) | Q(**parameters)) - - if order: - statements = statements.order_by(order) - - return statements - - def update(self, statement): - """ - Update the provided statement. - """ - Statement = self.get_model('statement') - Response = self.get_model('response') - - response_statement_cache = statement.response_statement_cache - - statement, created = Statement.objects.get_or_create(text=statement.text) - statement.extra_data = getattr(statement, 'extra_data', '') - statement.save() - - for _response_statement in response_statement_cache: - - response_statement, created = Statement.objects.get_or_create( - text=_response_statement.text - ) - response_statement.extra_data = getattr(_response_statement, 'extra_data', '') - response_statement.save() - - Response.objects.create( - statement=response_statement, - response=statement - ) - - return statement - - def get_random(self): - """ - Returns a random statement from the database - """ - Statement = self.get_model('statement') - return Statement.objects.order_by('?').first() - - def remove(self, statement_text): - """ - Removes the statement that matches the input text. - Removes any responses from statements if the response text matches the - input text. - """ - from django.db.models import Q - - Statement = self.get_model('statement') - Response = self.get_model('response') - - statements = Statement.objects.filter(text=statement_text) - - responses = Response.objects.filter( - Q(statement__text=statement_text) | Q(response__text=statement_text) - ) - - responses.delete() - statements.delete() - - def get_latest_response(self, conversation_id): - """ - Returns the latest response in a conversation if it exists. - Returns None if a matching conversation cannot be found. - """ - Response = self.get_model('response') - - response = Response.objects.filter( - conversations__id=conversation_id - ).order_by( - 'created_at' - ).last() - - if not response: - return None - - return response.response - - def create_conversation(self): - """ - Create a new conversation. - """ - Conversation = self.get_model('conversation') - conversation = Conversation.objects.create() - return conversation.id - - def add_to_conversation(self, conversation_id, statement, response): - """ - Add the statement and response to the conversation. - """ - Statement = self.get_model('statement') - Response = self.get_model('response') - - first_statement, created = Statement.objects.get_or_create(text=statement.text) - first_response, created = Statement.objects.get_or_create(text=response.text) - - response = Response.objects.create( - statement=first_statement, - response=first_response - ) - - response.conversations.add(conversation_id) - - def drop(self): - """ - Remove all data from the database. - """ - Statement = self.get_model('statement') - Response = self.get_model('response') - Conversation = self.get_model('conversation') - Tag = self.get_model('tag') - - Statement.objects.all().delete() - Response.objects.all().delete() - Conversation.objects.all().delete() - Tag.objects.all().delete() - - def get_response_statements(self): - """ - Return only statements that are in response to another statement. - A statement must exist which lists the closest matching statement in the - in_response_to field. Otherwise, the logic adapter may find a closest - matching statement that does not have a known response. - """ - Statement = self.get_model('statement') - Response = self.get_model('response') - - responses = Response.objects.all() - - return Statement.objects.filter(in_response__in=responses) diff --git a/chatter/chatterbot/trainers.py b/chatter/chatterbot/trainers.py index 1f634d1..e48c436 100644 --- a/chatter/chatterbot/trainers.py +++ b/chatter/chatterbot/trainers.py @@ -1,8 +1,9 @@ import logging import os import sys -from .conversation import Statement, Response + from . import utils +from .conversation import Statement, Response class Trainer(object): From 33307aa76f2a57c07c3305a2b7f4eaea31e6407d Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:35:35 -0400 Subject: [PATCH 07/50] no python2 nonsense --- chatter/chatterbot/comparisons.py | 11 +++-------- chatter/chatterbot/conversation.py | 7 ------- chatter/chatterbot/ext/sqlalchemy_app/types.py | 5 ----- .../chatterbot/input/variable_input_type_adapter.py | 6 ++---- chatter/chatterbot/preprocessors.py | 9 +-------- chatter/chatterbot/trainers.py | 8 ++++---- chatter/chatterbot/utils.py | 9 +-------- 7 files changed, 11 insertions(+), 44 deletions(-) diff --git a/chatter/chatterbot/comparisons.py b/chatter/chatterbot/comparisons.py index c500487..43cda14 100644 --- a/chatter/chatterbot/comparisons.py +++ b/chatter/chatterbot/comparisons.py @@ -58,19 +58,14 @@ class LevenshteinDistance(Comparator): :rtype: float """ - PYTHON = sys.version_info[0] - # Return 0 if either statement has a falsy text value if not statement.text or not other_statement.text: return 0 # Get the lowercase version of both strings - if PYTHON < 3: - statement_text = unicode(statement.text.lower()) # NOQA - other_statement_text = unicode(other_statement.text.lower()) # NOQA - else: - statement_text = str(statement.text.lower()) - other_statement_text = str(other_statement.text.lower()) + + statement_text = str(statement.text.lower()) + other_statement_text = str(other_statement.text.lower()) similarity = SequenceMatcher( None, diff --git a/chatter/chatterbot/conversation.py b/chatter/chatterbot/conversation.py index ea674aa..a798e17 100644 --- a/chatter/chatterbot/conversation.py +++ b/chatter/chatterbot/conversation.py @@ -33,13 +33,6 @@ class Statement(StatementMixin): except UnicodeEncodeError: pass - # Prefer decoded utf8-strings in Python 2.7 - if sys.version_info[0] < 3: - try: - text = text.decode('utf-8') - except UnicodeEncodeError: - pass - self.text = text self.tags = kwargs.pop('tags', []) self.in_response_to = kwargs.pop('in_response_to', []) diff --git a/chatter/chatterbot/ext/sqlalchemy_app/types.py b/chatter/chatterbot/ext/sqlalchemy_app/types.py index b48f4f6..ee9b123 100644 --- a/chatter/chatterbot/ext/sqlalchemy_app/types.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/types.py @@ -13,9 +13,4 @@ class UnicodeString(TypeDecorator): Coerce Python bytestrings to unicode before saving them to the database. """ - import sys - - if sys.version_info[0] < 3: - if isinstance(value, str): - value = value.decode('utf-8') return value diff --git a/chatter/chatterbot/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py index c0bd8cb..a93abe9 100644 --- a/chatter/chatterbot/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -14,10 +14,8 @@ class VariableInputTypeAdapter(InputAdapter): def detect_type(self, statement): import sys - if sys.version_info[0] < 3: - string_types = basestring # NOQA - else: - string_types = str + + string_types = str if hasattr(statement, 'text'): return self.OBJECT diff --git a/chatter/chatterbot/preprocessors.py b/chatter/chatterbot/preprocessors.py index f7043b1..59c6456 100644 --- a/chatter/chatterbot/preprocessors.py +++ b/chatter/chatterbot/preprocessors.py @@ -30,11 +30,7 @@ def unescape_html(chatbot, statement): import sys # Replace HTML escape characters - if sys.version_info[0] < 3: - from HTMLParser import HTMLParser - html = HTMLParser() - else: - import html + import html statement.text = html.unescape(statement.text) @@ -49,9 +45,6 @@ def convert_to_ascii(chatbot, statement): import unicodedata import sys - # Normalize unicode characters - if sys.version_info[0] < 3: - statement.text = unicode(statement.text) # NOQA text = unicodedata.normalize('NFKD', statement.text) text = text.encode('ascii', 'ignore').decode('utf-8') diff --git a/chatter/chatterbot/trainers.py b/chatter/chatterbot/trainers.py index e48c436..2d1aa59 100644 --- a/chatter/chatterbot/trainers.py +++ b/chatter/chatterbot/trainers.py @@ -393,10 +393,10 @@ class UbuntuCorpusTrainer(Trainer): file_kwargs = {} - if sys.version_info[0] > 2: - # Specify the encoding in Python versions 3 and up - file_kwargs['encoding'] = 'utf-8' - # WARNING: This might fail to read a unicode corpus file in Python 2.x + + # Specify the encoding in Python versions 3 and up + file_kwargs['encoding'] = 'utf-8' + # WARNING: This might fail to read a unicode corpus file in Python 2.x for file in glob.iglob(extracted_corpus_path): self.logger.info('Training from: {}'.format(file)) diff --git a/chatter/chatterbot/utils.py b/chatter/chatterbot/utils.py index 684d7f7..33c35c1 100644 --- a/chatter/chatterbot/utils.py +++ b/chatter/chatterbot/utils.py @@ -77,15 +77,8 @@ def input_function(): """ import sys - if sys.version_info[0] < 3: - user_input = str(raw_input()) # NOQA - # Avoid problems using format strings with unicode characters - if user_input: - user_input = user_input.decode('utf-8') - - else: - user_input = input() # NOQA + user_input = input() # NOQA return user_input From 1cde8566611f7ef72a0c496a268071048ea77bdf Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:37:52 -0400 Subject: [PATCH 08/50] proper import --- chatter/chatterbot/comparisons.py | 2 +- chatter/chatterbot/ext/sqlalchemy_app/models.py | 10 +++++----- chatter/chatterbot/input/gitter.py | 4 ++-- chatter/chatterbot/input/hipchat.py | 4 ++-- chatter/chatterbot/input/input_adapter.py | 2 +- chatter/chatterbot/input/mailgun.py | 4 ++-- chatter/chatterbot/input/microsoft.py | 4 ++-- chatter/chatterbot/input/terminal.py | 6 +++--- .../input/variable_input_type_adapter.py | 4 ++-- chatter/chatterbot/logic/logic_adapter.py | 8 ++++---- chatter/chatterbot/logic/low_confidence.py | 2 +- .../chatterbot/logic/mathematical_evaluation.py | 4 ++-- chatter/chatterbot/logic/multi_adapter.py | 2 +- chatter/chatterbot/logic/specific_response.py | 2 +- chatter/chatterbot/logic/time_adapter.py | 2 +- chatter/chatterbot/output/output_adapter.py | 2 +- chatter/chatterbot/storage/mongodb.py | 6 +++--- chatter/chatterbot/storage/sql_storage.py | 16 ++++++++-------- chatter/chatterbot/utils.py | 2 +- 19 files changed, 43 insertions(+), 43 deletions(-) diff --git a/chatter/chatterbot/comparisons.py b/chatter/chatterbot/comparisons.py index 43cda14..3abc009 100644 --- a/chatter/chatterbot/comparisons.py +++ b/chatter/chatterbot/comparisons.py @@ -125,7 +125,7 @@ class SynsetDistance(Comparator): """ from nltk.corpus import wordnet from nltk import word_tokenize - from chatterbot import utils + from chatter.chatterbot import utils import itertools tokens1 = word_tokenize(statement.text.lower()) diff --git a/chatter/chatterbot/ext/sqlalchemy_app/models.py b/chatter/chatterbot/ext/sqlalchemy_app/models.py index ae08193..41a05c0 100644 --- a/chatter/chatterbot/ext/sqlalchemy_app/models.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/models.py @@ -1,6 +1,6 @@ -from chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH -from chatterbot.conversation import StatementMixin -from chatterbot.ext.sqlalchemy_app.types import UnicodeString +from chatter.chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH +from chatter.chatterbot.conversation import StatementMixin +from chatter.chatterbot.ext.sqlalchemy_app.types import UnicodeString from sqlalchemy import Table, Column, Integer, DateTime, ForeignKey, PickleType from sqlalchemy.ext.declarative import declared_attr, declarative_base from sqlalchemy.orm import relationship @@ -72,8 +72,8 @@ class Statement(Base, StatementMixin): return [tag.name for tag in self.tags] def get_statement(self): - from chatterbot.conversation import Statement as StatementObject - from chatterbot.conversation import Response as ResponseObject + from chatter.chatterbot.conversation import Statement as StatementObject + from chatter.chatterbot.conversation import Response as ResponseObject statement = StatementObject( self.text, diff --git a/chatter/chatterbot/input/gitter.py b/chatter/chatterbot/input/gitter.py index 1b6d01f..9018e37 100644 --- a/chatter/chatterbot/input/gitter.py +++ b/chatter/chatterbot/input/gitter.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from time import sleep -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class Gitter(InputAdapter): diff --git a/chatter/chatterbot/input/hipchat.py b/chatter/chatterbot/input/hipchat.py index 70c52bc..b5da731 100644 --- a/chatter/chatterbot/input/hipchat.py +++ b/chatter/chatterbot/input/hipchat.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from time import sleep -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class HipChat(InputAdapter): diff --git a/chatter/chatterbot/input/input_adapter.py b/chatter/chatterbot/input/input_adapter.py index 46fb3a5..49c63db 100644 --- a/chatter/chatterbot/input/input_adapter.py +++ b/chatter/chatterbot/input/input_adapter.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from chatterbot.adapters import Adapter +from chatter.chatterbot.adapters import Adapter class InputAdapter(Adapter): diff --git a/chatter/chatterbot/input/mailgun.py b/chatter/chatterbot/input/mailgun.py index 9807a79..6fb78a8 100644 --- a/chatter/chatterbot/input/mailgun.py +++ b/chatter/chatterbot/input/mailgun.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals import datetime -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class Mailgun(InputAdapter): diff --git a/chatter/chatterbot/input/microsoft.py b/chatter/chatterbot/input/microsoft.py index 3d58dd8..054a9c7 100644 --- a/chatter/chatterbot/input/microsoft.py +++ b/chatter/chatterbot/input/microsoft.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from time import sleep -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class Microsoft(InputAdapter): diff --git a/chatter/chatterbot/input/terminal.py b/chatter/chatterbot/input/terminal.py index 40521d2..20cb3c2 100644 --- a/chatter/chatterbot/input/terminal.py +++ b/chatter/chatterbot/input/terminal.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter -from chatterbot.utils import input_function +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter +from chatter.chatterbot.utils import input_function class TerminalAdapter(InputAdapter): diff --git a/chatter/chatterbot/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py index a93abe9..e08bf53 100644 --- a/chatter/chatterbot/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement -from chatterbot.input import InputAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.input import InputAdapter class VariableInputTypeAdapter(InputAdapter): diff --git a/chatter/chatterbot/logic/logic_adapter.py b/chatter/chatterbot/logic/logic_adapter.py index 68f8088..1239cca 100644 --- a/chatter/chatterbot/logic/logic_adapter.py +++ b/chatter/chatterbot/logic/logic_adapter.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from chatterbot.adapters import Adapter -from chatterbot.utils import import_module +from chatter.chatterbot.adapters import Adapter +from chatter.chatterbot.utils import import_module class LogicAdapter(Adapter): @@ -18,8 +18,8 @@ class LogicAdapter(Adapter): def __init__(self, **kwargs): super(LogicAdapter, self).__init__(**kwargs) - from chatterbot.comparisons import levenshtein_distance - from chatterbot.response_selection import get_first_response + from chatter.chatterbot.comparisons import levenshtein_distance + from chatter.chatterbot.response_selection import get_first_response # Import string module parameters if 'statement_comparison_function' in kwargs: diff --git a/chatter/chatterbot/logic/low_confidence.py b/chatter/chatterbot/logic/low_confidence.py index 2e9dd65..0e3d5d8 100644 --- a/chatter/chatterbot/logic/low_confidence.py +++ b/chatter/chatterbot/logic/low_confidence.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement +from chatter.chatterbot.conversation import Statement from .best_match import BestMatch diff --git a/chatter/chatterbot/logic/mathematical_evaluation.py b/chatter/chatterbot/logic/mathematical_evaluation.py index 02af55e..af27548 100644 --- a/chatter/chatterbot/logic/mathematical_evaluation.py +++ b/chatter/chatterbot/logic/mathematical_evaluation.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from chatterbot.conversation import Statement -from chatterbot.logic import LogicAdapter +from chatter.chatterbot.conversation import Statement +from chatter.chatterbot.logic import LogicAdapter class MathematicalEvaluation(LogicAdapter): diff --git a/chatter/chatterbot/logic/multi_adapter.py b/chatter/chatterbot/logic/multi_adapter.py index 145424a..5e35dfd 100644 --- a/chatter/chatterbot/logic/multi_adapter.py +++ b/chatter/chatterbot/logic/multi_adapter.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from collections import Counter -from chatterbot import utils +from chatter.chatterbot import utils from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/logic/specific_response.py b/chatter/chatterbot/logic/specific_response.py index d3fa38a..101dd3b 100644 --- a/chatter/chatterbot/logic/specific_response.py +++ b/chatter/chatterbot/logic/specific_response.py @@ -16,7 +16,7 @@ class SpecificResponseAdapter(LogicAdapter): def __init__(self, **kwargs): super(SpecificResponseAdapter, self).__init__(**kwargs) - from chatterbot.conversation import Statement + from chatter.chatterbot.conversation import Statement self.input_text = kwargs.get('input_text') diff --git a/chatter/chatterbot/logic/time_adapter.py b/chatter/chatterbot/logic/time_adapter.py index 5047210..b177a67 100644 --- a/chatter/chatterbot/logic/time_adapter.py +++ b/chatter/chatterbot/logic/time_adapter.py @@ -81,7 +81,7 @@ class TimeLogicAdapter(LogicAdapter): return features def process(self, statement): - from chatterbot.conversation import Statement + from chatter.chatterbot.conversation import Statement now = datetime.now() diff --git a/chatter/chatterbot/output/output_adapter.py b/chatter/chatterbot/output/output_adapter.py index 631e343..5d13dd7 100644 --- a/chatter/chatterbot/output/output_adapter.py +++ b/chatter/chatterbot/output/output_adapter.py @@ -1,4 +1,4 @@ -from chatterbot.adapters import Adapter +from chatter.chatterbot.adapters import Adapter class OutputAdapter(Adapter): diff --git a/chatter/chatterbot/storage/mongodb.py b/chatter/chatterbot/storage/mongodb.py index 744d672..06ced53 100644 --- a/chatter/chatterbot/storage/mongodb.py +++ b/chatter/chatterbot/storage/mongodb.py @@ -1,4 +1,4 @@ -from chatterbot.storage import StorageAdapter +from chatter.chatterbot.storage import StorageAdapter class Query(object): @@ -116,7 +116,7 @@ class MongoDatabaseAdapter(StorageAdapter): """ Return the class for the statement model. """ - from chatterbot.conversation import Statement + from chatter.chatterbot.conversation import Statement # Create a storage-aware statement statement = Statement @@ -128,7 +128,7 @@ class MongoDatabaseAdapter(StorageAdapter): """ Return the class for the response model. """ - from chatterbot.conversation import Response + from chatter.chatterbot.conversation import Response # Create a storage-aware response response = Response diff --git a/chatter/chatterbot/storage/sql_storage.py b/chatter/chatterbot/storage/sql_storage.py index ed1153c..32b9535 100644 --- a/chatter/chatterbot/storage/sql_storage.py +++ b/chatter/chatterbot/storage/sql_storage.py @@ -1,8 +1,8 @@ -from chatterbot.storage import StorageAdapter +from chatter.chatterbot.storage import StorageAdapter def get_response_table(response): - from chatterbot.ext.sqlalchemy_app.models import Response + from chatter.chatterbot.ext.sqlalchemy_app.models import Response return Response(text=response.text, occurrence=response.occurrence) @@ -86,28 +86,28 @@ class SQLStorageAdapter(StorageAdapter): """ Return the statement model. """ - from chatterbot.ext.sqlalchemy_app.models import Statement + from chatter.chatterbot.ext.sqlalchemy_app.models import Statement return Statement def get_response_model(self): """ Return the response model. """ - from chatterbot.ext.sqlalchemy_app.models import Response + from chatter.chatterbot.ext.sqlalchemy_app.models import Response return Response def get_conversation_model(self): """ Return the conversation model. """ - from chatterbot.ext.sqlalchemy_app.models import Conversation + from chatter.chatterbot.ext.sqlalchemy_app.models import Conversation return Conversation def get_tag_model(self): """ Return the conversation model. """ - from chatterbot.ext.sqlalchemy_app.models import Tag + from chatter.chatterbot.ext.sqlalchemy_app.models import Tag return Tag def count(self): @@ -379,14 +379,14 @@ class SQLStorageAdapter(StorageAdapter): """ Drop the database attached to a given adapter. """ - from chatterbot.ext.sqlalchemy_app.models import Base + from chatter.chatterbot.ext.sqlalchemy_app.models import Base Base.metadata.drop_all(self.engine) def create(self): """ Populate the database with the tables. """ - from chatterbot.ext.sqlalchemy_app.models import Base + from chatter.chatterbot.ext.sqlalchemy_app.models import Base Base.metadata.create_all(self.engine) def _session_finish(self, session, statement_text=None): diff --git a/chatter/chatterbot/utils.py b/chatter/chatterbot/utils.py index 33c35c1..391a06a 100644 --- a/chatter/chatterbot/utils.py +++ b/chatter/chatterbot/utils.py @@ -130,7 +130,7 @@ def remove_stopwords(tokens, language): Stop words are words like "is, the, a, ..." Be sure to download the required NLTK corpus before calling this function: - - from chatterbot.utils import nltk_download_corpus + - from chatter.chatterbot.utils import nltk_download_corpus - nltk_download_corpus('corpora/stopwords') """ from nltk.corpus import stopwords From a7bc72493efe536cfb50b79ec1a8889682047ac8 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:38:24 -0400 Subject: [PATCH 09/50] optimize imports --- chatter/chatterbot/comparisons.py | 1 - chatter/chatterbot/conversation.py | 1 - chatter/chatterbot/ext/sqlalchemy_app/models.py | 7 ++++--- chatter/chatterbot/input/variable_input_type_adapter.py | 2 -- chatter/chatterbot/logic/low_confidence.py | 1 - chatter/chatterbot/logic/multi_adapter.py | 1 - chatter/chatterbot/preprocessors.py | 3 --- chatter/chatterbot/utils.py | 2 -- 8 files changed, 4 insertions(+), 14 deletions(-) diff --git a/chatter/chatterbot/comparisons.py b/chatter/chatterbot/comparisons.py index 3abc009..59efa95 100644 --- a/chatter/chatterbot/comparisons.py +++ b/chatter/chatterbot/comparisons.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import sys """ diff --git a/chatter/chatterbot/conversation.py b/chatter/chatterbot/conversation.py index a798e17..c9dfcb4 100644 --- a/chatter/chatterbot/conversation.py +++ b/chatter/chatterbot/conversation.py @@ -25,7 +25,6 @@ class Statement(StatementMixin): """ def __init__(self, text, **kwargs): - import sys # Try not to allow non-string types to be passed to statements try: diff --git a/chatter/chatterbot/ext/sqlalchemy_app/models.py b/chatter/chatterbot/ext/sqlalchemy_app/models.py index 41a05c0..d30bb75 100644 --- a/chatter/chatterbot/ext/sqlalchemy_app/models.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/models.py @@ -1,11 +1,12 @@ -from chatter.chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH -from chatter.chatterbot.conversation import StatementMixin -from chatter.chatterbot.ext.sqlalchemy_app.types import UnicodeString from sqlalchemy import Table, Column, Integer, DateTime, ForeignKey, PickleType from sqlalchemy.ext.declarative import declared_attr, declarative_base from sqlalchemy.orm import relationship from sqlalchemy.sql import func +from chatter.chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH +from chatter.chatterbot.conversation import StatementMixin +from chatter.chatterbot.ext.sqlalchemy_app.types import UnicodeString + class ModelBase(object): """ diff --git a/chatter/chatterbot/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py index e08bf53..199d86b 100644 --- a/chatter/chatterbot/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -12,8 +12,6 @@ class VariableInputTypeAdapter(InputAdapter): VALID_FORMATS = (JSON, TEXT, OBJECT, ) def detect_type(self, statement): - import sys - string_types = str diff --git a/chatter/chatterbot/logic/low_confidence.py b/chatter/chatterbot/logic/low_confidence.py index 0e3d5d8..585cf20 100644 --- a/chatter/chatterbot/logic/low_confidence.py +++ b/chatter/chatterbot/logic/low_confidence.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals from chatter.chatterbot.conversation import Statement - from .best_match import BestMatch diff --git a/chatter/chatterbot/logic/multi_adapter.py b/chatter/chatterbot/logic/multi_adapter.py index 5e35dfd..e83cc00 100644 --- a/chatter/chatterbot/logic/multi_adapter.py +++ b/chatter/chatterbot/logic/multi_adapter.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals from collections import Counter from chatter.chatterbot import utils - from .logic_adapter import LogicAdapter diff --git a/chatter/chatterbot/preprocessors.py b/chatter/chatterbot/preprocessors.py index 59c6456..2ab0ee0 100644 --- a/chatter/chatterbot/preprocessors.py +++ b/chatter/chatterbot/preprocessors.py @@ -27,7 +27,6 @@ def unescape_html(chatbot, statement): Convert escaped html characters into unescaped html characters. For example: "<b>" becomes "". """ - import sys # Replace HTML escape characters import html @@ -43,8 +42,6 @@ def convert_to_ascii(chatbot, statement): For example: "på fédéral" becomes "pa federal". """ import unicodedata - import sys - text = unicodedata.normalize('NFKD', statement.text) text = text.encode('ascii', 'ignore').decode('utf-8') diff --git a/chatter/chatterbot/utils.py b/chatter/chatterbot/utils.py index 391a06a..c8c670d 100644 --- a/chatter/chatterbot/utils.py +++ b/chatter/chatterbot/utils.py @@ -75,8 +75,6 @@ def input_function(): Normalizes reading input between python 2 and 3. The function 'raw_input' becomes 'input' in Python 3. """ - import sys - user_input = input() # NOQA From 5434da22bc3070682e6628657bce24f5a0e5b560 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:45:12 -0400 Subject: [PATCH 10/50] better default --- chatter/chatterbot/storage/mongodb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chatter/chatterbot/storage/mongodb.py b/chatter/chatterbot/storage/mongodb.py index 06ced53..1ddb625 100644 --- a/chatter/chatterbot/storage/mongodb.py +++ b/chatter/chatterbot/storage/mongodb.py @@ -3,8 +3,11 @@ from chatter.chatterbot.storage import StorageAdapter class Query(object): - def __init__(self, query={}): - self.query = query + def __init__(self, query=None): + if query is None: + self.query = {} + else: + self.query = query def value(self): return self.query.copy() From 04fd25d4bd27592eebae12af203dd4790c91ad2f Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 11:46:12 -0400 Subject: [PATCH 11/50] pep8 --- chatter/chatterbot/__main__.py | 1 - chatter/chatterbot/corpus.py | 1 - .../chatterbot/ext/sqlalchemy_app/models.py | 1 - chatter/chatterbot/input/microsoft.py | 6 ++-- .../input/variable_input_type_adapter.py | 3 +- chatter/chatterbot/logic/multi_adapter.py | 2 +- chatter/chatterbot/logic/time_adapter.py | 4 +-- chatter/chatterbot/storage/storage_adapter.py | 7 ++-- chatter/chatterbot/trainers.py | 5 ++- chatter/chatterbot/utils.py | 2 +- chatter/info.json | 36 ++++++++++++++----- 11 files changed, 42 insertions(+), 26 deletions(-) diff --git a/chatter/chatterbot/__main__.py b/chatter/chatterbot/__main__.py index a27f483..0322854 100644 --- a/chatter/chatterbot/__main__.py +++ b/chatter/chatterbot/__main__.py @@ -1,6 +1,5 @@ import sys - if __name__ == '__main__': import importlib diff --git a/chatter/chatterbot/corpus.py b/chatter/chatterbot/corpus.py index 65da8eb..4bf0e4b 100644 --- a/chatter/chatterbot/corpus.py +++ b/chatter/chatterbot/corpus.py @@ -5,7 +5,6 @@ View the corpus on GitHub at https://github.com/gunthercox/chatterbot-corpus from chatterbot_corpus import Corpus - __all__ = ( 'Corpus', ) diff --git a/chatter/chatterbot/ext/sqlalchemy_app/models.py b/chatter/chatterbot/ext/sqlalchemy_app/models.py index d30bb75..6a7dc00 100644 --- a/chatter/chatterbot/ext/sqlalchemy_app/models.py +++ b/chatter/chatterbot/ext/sqlalchemy_app/models.py @@ -29,7 +29,6 @@ class ModelBase(object): Base = declarative_base(cls=ModelBase) - tag_association_table = Table( 'tag_association', Base.metadata, diff --git a/chatter/chatterbot/input/microsoft.py b/chatter/chatterbot/input/microsoft.py index 054a9c7..3a255bf 100644 --- a/chatter/chatterbot/input/microsoft.py +++ b/chatter/chatterbot/input/microsoft.py @@ -23,10 +23,10 @@ class Microsoft(InputAdapter): # NOTE: Direct Line client credentials are different from your bot's # credentials - self.direct_line_token_or_secret = kwargs.\ + self.direct_line_token_or_secret = kwargs. \ get('direct_line_token_or_secret') - authorization_header = 'BotConnector {}'.\ + authorization_header = 'BotConnector {}'. \ format(self.direct_line_token_or_secret) self.headers = { @@ -64,7 +64,7 @@ class Microsoft(InputAdapter): def get_most_recent_message(self): import requests - endpoint = '{host}/api/conversations/{id}/messages'\ + endpoint = '{host}/api/conversations/{id}/messages' \ .format(host=self.directline_host, id=self.conversation_id) diff --git a/chatter/chatterbot/input/variable_input_type_adapter.py b/chatter/chatterbot/input/variable_input_type_adapter.py index 199d86b..d2d598c 100644 --- a/chatter/chatterbot/input/variable_input_type_adapter.py +++ b/chatter/chatterbot/input/variable_input_type_adapter.py @@ -5,11 +5,10 @@ from chatter.chatterbot.input import InputAdapter class VariableInputTypeAdapter(InputAdapter): - JSON = 'json' TEXT = 'text' OBJECT = 'object' - VALID_FORMATS = (JSON, TEXT, OBJECT, ) + VALID_FORMATS = (JSON, TEXT, OBJECT,) def detect_type(self, statement): diff --git a/chatter/chatterbot/logic/multi_adapter.py b/chatter/chatterbot/logic/multi_adapter.py index e83cc00..6cfe30f 100644 --- a/chatter/chatterbot/logic/multi_adapter.py +++ b/chatter/chatterbot/logic/multi_adapter.py @@ -51,7 +51,7 @@ class MultiLogicAdapter(LogicAdapter): if adapter.can_process(statement): output = adapter.process(statement) - results.append((output.confidence, output, )) + results.append((output.confidence, output,)) self.logger.info( '{} selected "{}" as a response with a confidence of {}'.format( diff --git a/chatter/chatterbot/logic/time_adapter.py b/chatter/chatterbot/logic/time_adapter.py index b177a67..72902e2 100644 --- a/chatter/chatterbot/logic/time_adapter.py +++ b/chatter/chatterbot/logic/time_adapter.py @@ -42,8 +42,8 @@ class TimeLogicAdapter(LogicAdapter): ]) labeled_data = ( - [(name, 0) for name in self.negative] + - [(name, 1) for name in self.positive] + [(name, 0) for name in self.negative] + + [(name, 1) for name in self.positive] ) train_set = [ diff --git a/chatter/chatterbot/storage/storage_adapter.py b/chatter/chatterbot/storage/storage_adapter.py index 50beac7..046ae63 100644 --- a/chatter/chatterbot/storage/storage_adapter.py +++ b/chatter/chatterbot/storage/storage_adapter.py @@ -24,12 +24,12 @@ class StorageAdapter(object): # The string must be lowercase model_name = model_name.lower() - kwarg_model_key = '%s_model' % (model_name, ) + kwarg_model_key = '%s_model' % (model_name,) if kwarg_model_key in self.kwargs: return self.kwargs.get(kwarg_model_key) - get_model_method = getattr(self, 'get_%s_model' % (model_name, )) + get_model_method = getattr(self, 'get_%s_model' % (model_name,)) return get_model_method() @@ -157,7 +157,8 @@ class StorageAdapter(object): class EmptyDatabaseException(Exception): - def __init__(self, value='The database currently contains no entries. At least one entry is expected. You may need to train your chat bot to populate your database.'): + def __init__(self, + value='The database currently contains no entries. At least one entry is expected. You may need to train your chat bot to populate your database.'): self.value = value def __str__(self): diff --git a/chatter/chatterbot/trainers.py b/chatter/chatterbot/trainers.py index 2d1aa59..456176c 100644 --- a/chatter/chatterbot/trainers.py +++ b/chatter/chatterbot/trainers.py @@ -61,8 +61,8 @@ class Trainer(object): def __init__(self, value=None): default = ( - 'A training class must be specified before calling train(). ' + - 'See http://chatterbot.readthedocs.io/en/stable/training.html' + 'A training class must be specified before calling train(). ' + + 'See http://chatterbot.readthedocs.io/en/stable/training.html' ) self.value = value or default @@ -393,7 +393,6 @@ class UbuntuCorpusTrainer(Trainer): file_kwargs = {} - # Specify the encoding in Python versions 3 and up file_kwargs['encoding'] = 'utf-8' # WARNING: This might fail to read a unicode corpus file in Python 2.x diff --git a/chatter/chatterbot/utils.py b/chatter/chatterbot/utils.py index c8c670d..e18549e 100644 --- a/chatter/chatterbot/utils.py +++ b/chatter/chatterbot/utils.py @@ -76,7 +76,7 @@ def input_function(): The function 'raw_input' becomes 'input' in Python 3. """ - user_input = input() # NOQA + user_input = input() # NOQA return user_input diff --git a/chatter/info.json b/chatter/info.json index bd4870a..d2ebffd 100644 --- a/chatter/info.json +++ b/chatter/info.json @@ -1,10 +1,30 @@ { - "author" : ["Bobloy"], - "bot_version" : [3,0,0], - "description" : "Create an offline chatbot that talks like your average member using Machine Learning", - "hidden" : false, - "install_msg" : "Thank you for installing Chatter!", - "requirements" : ["sqlalchemy<1.3,>=1.2", "python-twitter<4.0,>=3.0", "python-dateutil<2.7,>=2.6", "pymongo<4.0,>=3.3", "nltk<4.0,>=3.2", "mathparse<0.2,>=0.1", "chatterbot-corpus<1.2,>=1.1"], - "short" : "Local Chatbot run on machine learning", - "tags" : ["chat", "chatbot", "cleverbot", "clever","bobloy"] + "author": [ + "Bobloy" + ], + "bot_version": [ + 3, + 0, + 0 + ], + "description": "Create an offline chatbot that talks like your average member using Machine Learning", + "hidden": false, + "install_msg": "Thank you for installing Chatter!", + "requirements": [ + "sqlalchemy<1.3,>=1.2", + "python-twitter<4.0,>=3.0", + "python-dateutil<2.7,>=2.6", + "pymongo<4.0,>=3.3", + "nltk<4.0,>=3.2", + "mathparse<0.2,>=0.1", + "chatterbot-corpus<1.2,>=1.1" + ], + "short": "Local Chatbot run on machine learning", + "tags": [ + "chat", + "chatbot", + "cleverbot", + "clever", + "bobloy" + ] } \ No newline at end of file From 0c721a2dbe2c15ca2da77b7e42a4149c7e9272bb Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 12:24:16 -0400 Subject: [PATCH 12/50] naming --- chatter/__init__.py | 8 ++++++-- chatter/chatterbot/input/__init__.py | 2 +- chatter/chatterbot/storage/__init__.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/chatter/__init__.py b/chatter/__init__.py index 2d7a8e8..3056b82 100644 --- a/chatter/__init__.py +++ b/chatter/__init__.py @@ -1,5 +1,9 @@ -from .chatter import Chatter - +from .chat import Chatter +from . import chatterbot def setup(bot): bot.add_cog(Chatter(bot)) + +__all__ = ( + 'chatterbot' +) diff --git a/chatter/chatterbot/input/__init__.py b/chatter/chatterbot/input/__init__.py index 625b583..53c53f9 100644 --- a/chatter/chatterbot/input/__init__.py +++ b/chatter/chatterbot/input/__init__.py @@ -1,6 +1,6 @@ +from .input_adapter import InputAdapter from .gitter import Gitter from .hipchat import HipChat -from .input_adapter import InputAdapter from .mailgun import Mailgun from .microsoft import Microsoft from .terminal import TerminalAdapter diff --git a/chatter/chatterbot/storage/__init__.py b/chatter/chatterbot/storage/__init__.py index c456292..77d3e04 100644 --- a/chatter/chatterbot/storage/__init__.py +++ b/chatter/chatterbot/storage/__init__.py @@ -1,6 +1,6 @@ +from .storage_adapter import StorageAdapter from .mongodb import MongoDatabaseAdapter from .sql_storage import SQLStorageAdapter -from .storage_adapter import StorageAdapter __all__ = ( 'StorageAdapter', From f27787f76b44db1d69257e0faa16bcf4feaf2962 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 12:24:48 -0400 Subject: [PATCH 13/50] rename --- chatter/{chatter.py => chat.py} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename chatter/{chatter.py => chat.py} (96%) diff --git a/chatter/chatter.py b/chatter/chat.py similarity index 96% rename from chatter/chatter.py rename to chatter/chat.py index 0a083a9..eab5a8e 100644 --- a/chatter/chatter.py +++ b/chatter/chat.py @@ -5,8 +5,8 @@ import discord from discord.ext import commands from redbot.core import Config -from .chatterbot import ChatBot -from .chatterbot.trainers import ListTrainer +from chatter.chatterbot import ChatBot +from chatter.chatterbot.trainers import ListTrainer class Chatter: @@ -25,7 +25,7 @@ class Chatter: self.chatbot = ChatBot( "ChatterBot", - storage_adapter='chatterbot.storage.SQLStorageAdapter', + storage_adapter='chatter.chatterbotstorage.SQLStorageAdapter', database='./database.sqlite3' ) self.chatbot.set_trainer(ListTrainer) From af41b0c015a4aad7a1dd257bce23f0d54574ddf2 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 12:29:19 -0400 Subject: [PATCH 14/50] chatter. --- chatter/chat.py | 2 +- chatter/chatterbot/chatterbot.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chatter/chat.py b/chatter/chat.py index eab5a8e..42a6f6c 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -25,7 +25,7 @@ class Chatter: self.chatbot = ChatBot( "ChatterBot", - storage_adapter='chatter.chatterbotstorage.SQLStorageAdapter', + storage_adapter='chatter.chatterbot.storage.SQLStorageAdapter', database='./database.sqlite3' ) self.chatbot.set_trainer(ListTrainer) diff --git a/chatter/chatterbot/chatterbot.py b/chatter/chatterbot/chatterbot.py index 40fd05d..c7a92cb 100644 --- a/chatter/chatterbot/chatterbot.py +++ b/chatter/chatterbot/chatterbot.py @@ -22,15 +22,15 @@ class ChatBot(object): self.default_session = None - storage_adapter = kwargs.get('storage_adapter', 'chatterbot.storage.SQLStorageAdapter') + storage_adapter = kwargs.get('storage_adapter', 'chatter.chatterbot.storage.SQLStorageAdapter') logic_adapters = kwargs.get('logic_adapters', [ - 'chatterbot.logic.BestMatch' + 'chatter.chatterbot.logic.BestMatch' ]) - input_adapter = kwargs.get('input_adapter', 'chatterbot.input.VariableInputTypeAdapter') + input_adapter = kwargs.get('input_adapter', 'chatter.chatterbot.input.VariableInputTypeAdapter') - output_adapter = kwargs.get('output_adapter', 'chatterbot.output.OutputAdapter') + output_adapter = kwargs.get('output_adapter', 'chatter.chatterbot.output.OutputAdapter') # Check that each adapter is a valid subclass of it's respective parent utils.validate_adapter_class(storage_adapter, StorageAdapter) @@ -47,7 +47,7 @@ class ChatBot(object): # Add required system logic adapter self.logic.system_adapters.append( - utils.initialize_class('chatterbot.logic.NoKnowledgeAdapter', **kwargs) + utils.initialize_class('chatter.chatterbot.logic.NoKnowledgeAdapter', **kwargs) ) for adapter in logic_adapters: @@ -61,7 +61,7 @@ class ChatBot(object): preprocessors = kwargs.get( 'preprocessors', [ - 'chatterbot.preprocessors.clean_whitespace' + 'chatter.chatterbot.preprocessors.clean_whitespace' ] ) @@ -71,7 +71,7 @@ class ChatBot(object): self.preprocessors.append(utils.import_module(preprocessor)) # Use specified trainer or fall back to the default - trainer = kwargs.get('trainer', 'chatterbot.trainers.Trainer') + trainer = kwargs.get('trainer', 'chatter.chatterbot.trainers.Trainer') TrainerClass = utils.import_module(trainer) self.trainer = TrainerClass(self.storage, **kwargs) self.training_data = kwargs.get('training_data') From c412ad238eb5d683bb41fef7f61d446689b2062b Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 12:30:15 -0400 Subject: [PATCH 15/50] import order --- chatter/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chatter/__init__.py b/chatter/__init__.py index 3056b82..cc101b7 100644 --- a/chatter/__init__.py +++ b/chatter/__init__.py @@ -1,9 +1,11 @@ -from .chat import Chatter from . import chatterbot +from .chat import Chatter + def setup(bot): bot.add_cog(Chatter(bot)) + __all__ = ( 'chatterbot' ) From 3b086d4c03186e0c6922916df0b52c099134db31 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 12:55:22 -0400 Subject: [PATCH 16/50] current progress --- chatter/chat.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/chatter/chat.py b/chatter/chat.py index 42a6f6c..2b3d8ea 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -26,7 +26,7 @@ class Chatter: self.chatbot = ChatBot( "ChatterBot", storage_adapter='chatter.chatterbot.storage.SQLStorageAdapter', - database='./database.sqlite3' + database='chatter/database/database.sqlite3' ) self.chatbot.set_trainer(ListTrainer) @@ -91,6 +91,18 @@ class Chatter: await self.config.guild(ctx.guild).days.set(days) await ctx.send("Success") + @chatter.command() + async def backup(self, ctx, backupname): + """ + Backup your training data to a json for later use + :param ctx: + :param backupname: + :return: + """ + + self.chatbot.trainer.export_for_training('./{}.json'.format(backupname)) + + @chatter.command() async def train(self, ctx: commands.Context, channel: discord.TextChannel = None): """ From 3e0773ee1ea9d380ba9f9dbf606cbbd8a667258a Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 14:31:56 -0400 Subject: [PATCH 17/50] changes --- chatter/chat.py | 25 ++++++++++++++----------- chatter/chatterbot/trainers.py | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/chatter/chat.py b/chatter/chat.py index 2b3d8ea..8301411 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -26,7 +26,7 @@ class Chatter: self.chatbot = ChatBot( "ChatterBot", storage_adapter='chatter.chatterbot.storage.SQLStorageAdapter', - database='chatter/database/database.sqlite3' + database='./database.sqlite3' ) self.chatbot.set_trainer(ListTrainer) @@ -95,16 +95,17 @@ class Chatter: async def backup(self, ctx, backupname): """ Backup your training data to a json for later use - :param ctx: - :param backupname: - :return: """ + await ctx.send("Backing up data, this may take a while") + future = await self.loop.run_in_executor(None, self.chatbot.trainer.export_for_training, './{}.json'.format(backupname)) - self.chatbot.trainer.export_for_training('./{}.json'.format(backupname)) - + if future: + await ctx.send("Backup successful!") + else: + await ctx.send("Error occurred :(") @chatter.command() - async def train(self, ctx: commands.Context, channel: discord.TextChannel = None): + async def train(self, ctx: commands.Context, channel: discord.TextChannel): """ Trains the bot based on language in this guild """ @@ -146,7 +147,9 @@ class Chatter: return text = text.replace(to_strip, "", 1) async with channel.typing(): - response = self.chatbot.get_response(text) - if not response: - response = ":thinking:" - await channel.send(response) + future = await self.loop.run_in_executor(None, self.chatbot.get_response, text) + + if future: + await channel.send(str(future)) + else: + await channel.send(':thinking:') diff --git a/chatter/chatterbot/trainers.py b/chatter/chatterbot/trainers.py index 456176c..42ccd47 100644 --- a/chatter/chatterbot/trainers.py +++ b/chatter/chatterbot/trainers.py @@ -85,7 +85,7 @@ class Trainer(object): import json export = {'conversations': self._generate_export_data()} with open(file_path, 'w+') as jsonfile: - json.dump(export, jsonfile, ensure_ascii=False) + json.dump(export, jsonfile, ensure_ascii=True) class ListTrainer(Trainer): From c636fe34227056db609b9054495d979f0f0eb9a2 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 14:57:29 -0400 Subject: [PATCH 18/50] Markdown? --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 44ef0f8..a82aeaa 100644 --- a/README.md +++ b/README.md @@ -12,21 +12,21 @@ Cog Function | immortal | **Private** | Cog designed for a specific server, not recommended to install | | leaver | **Incomplete** | Send a message in a channel when a user leaves the server | | reactrestrict | **Alpha** | Removes reactions by role per channel | -| stealemoji | **Alpha** | Steals any custom emoji it sees | +| stealemoji | **Alpha** | Steals any custom emoji it sees in a reaction | | werewolf | **Incomplete** | Play the classic party game Werewolf within discord | +| test | test |
"Click to expand"this is hidden
| Cog Status Descriptions - - ccrole: May have some bugs, please create an issue if you find any - - chatter: Missing some key features, but currently functional - - fight: Still in-progress, a massive project - - flag: Not yet ported to v3 - - hangman: Not yet ported to v3 - - immortal: Designed for a specific server, not recommended to install - - leaver: Not yet ported to v3 - - reactrestrict: A bit clunky, but functional - - stealemoji: Some planned upgrades for server generation - - werewolf: Another massive project, will be fully customizable + - [x] ccrole: May have some bugs, please create an issue if you find any + - [ ] chatter: Missing some key features, but currently functional + - [ ] fight: Still in-progress, a massive project + - [x] flag: Not yet ported to v3 + - [ ] hangman: Not yet ported to v3 + - [ ] immortal: Designed for a specific server, not recommended to install + - [ ] leaver: Not yet ported to v3 + - [ ] reactrestrict: A bit clunky, but functional + - [ ] stealemoji: Some planned upgrades for server generation + - [ ] werewolf: Another massive project, will be fully customizable -Many of these are functional in my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) - \ No newline at end of file +Check out my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) \ No newline at end of file From 472d9d11ce0ed7195511bed7854f4d61db73f56d Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 15:01:34 -0400 Subject: [PATCH 19/50] readme dropdown --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a82aeaa..895f75a 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,16 @@ Cog Function | Name | Status | Description | --- | --- | --- | -| ccrole | **Beta** | Create custom commands that also assign roles | -| chatter | **Alpha** | Chat-bot trained to talk like your guild -| fight | **Incomplete** | Organize bracket tournaments within discord | -| flag | **Beta** | Create temporary marks on users that expire after specified time | -| hangman | **Incomplete** | Play a game of hangman | -| immortal | **Private** | Cog designed for a specific server, not recommended to install | -| leaver | **Incomplete** | Send a message in a channel when a user leaves the server | -| reactrestrict | **Alpha** | Removes reactions by role per channel | -| stealemoji | **Alpha** | Steals any custom emoji it sees in a reaction | -| werewolf | **Incomplete** | Play the classic party game Werewolf within discord | -| test | test |
"Click to expand"this is hidden
| +| ccrole | **Beta** |
Create custom commands that also assign rolesMay have some bugs, please create an issue if you find any
| +| chatter | **Alpha** |
Chat-bot trained to talk like your guildMissing some key features, but currently functional
| +| fight | **Incomplete** |
Organize bracket tournaments within discordStill in-progress, a massive project
| +| flag | **Beta** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| +| hangman | **Incomplete** |
Play a game of hangmanNot yet ported to v3
| +| immortal | **Private** |
Cog designed for a specific server, not recommended to installDesigned for a specific server, not recommended to install
| +| leaver | **Incomplete** |
Send a message in a channel when a user leaves the serverNot yet ported to v3
| +| reactrestrict | **Alpha** |
Removes reactions by role per channelA bit clunky, but functional
| +| stealemoji | **Alpha** |
Steals any custom emoji it sees in a reactionSome planned upgrades for server generation
| +| werewolf | **Incomplete** |
Play the classic party game Werewolf within discordAnother massive project, will be fully customizable
| Cog Status Descriptions From 09e22d0d3e490a137e2c62e44377f83e0e32a272 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 15:02:22 -0400 Subject: [PATCH 20/50] Final Form --- README.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/README.md b/README.md index 895f75a..de1d42d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Cog Function -| Name | Status | Description +| Name | Status | Description (Click to see full status) | --- | --- | --- | | ccrole | **Beta** |
Create custom commands that also assign rolesMay have some bugs, please create an issue if you find any
| | chatter | **Alpha** |
Chat-bot trained to talk like your guildMissing some key features, but currently functional
| @@ -15,17 +15,5 @@ Cog Function | stealemoji | **Alpha** |
Steals any custom emoji it sees in a reactionSome planned upgrades for server generation
| | werewolf | **Incomplete** |
Play the classic party game Werewolf within discordAnother massive project, will be fully customizable
| -Cog Status Descriptions - - - [x] ccrole: May have some bugs, please create an issue if you find any - - [ ] chatter: Missing some key features, but currently functional - - [ ] fight: Still in-progress, a massive project - - [x] flag: Not yet ported to v3 - - [ ] hangman: Not yet ported to v3 - - [ ] immortal: Designed for a specific server, not recommended to install - - [ ] leaver: Not yet ported to v3 - - [ ] reactrestrict: A bit clunky, but functional - - [ ] stealemoji: Some planned upgrades for server generation - - [ ] werewolf: Another massive project, will be fully customizable Check out my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) \ No newline at end of file From d1944dca68cd1bf4c2b5d8c8a3ae7d3ffa937627 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:10:11 -0400 Subject: [PATCH 21/50] Remove immortal cog --- immortal/immortal.py | 243 ------------------------------------------- immortal/info.json | 9 -- 2 files changed, 252 deletions(-) delete mode 100644 immortal/immortal.py delete mode 100644 immortal/info.json diff --git a/immortal/immortal.py b/immortal/immortal.py deleted file mode 100644 index c20908c..0000000 --- a/immortal/immortal.py +++ /dev/null @@ -1,243 +0,0 @@ -import discord -import asyncio -import os -from datetime import datetime -from discord.ext import commands - -from .utils.dataIO import dataIO -from .utils import checks - - -class Immortal: - """Creates a goodbye message when people leave""" - - def __init__(self, bot): - self.bot = bot - self.path = "data/Fox-Cogs/immortal" - self.file_path = "data/Fox-Cogs/immortal/immortal.json" - self.the_data = dataIO.load_json(self.file_path) - - def save_data(self): - """Saves the json""" - dataIO.save_json(self.file_path, self.the_data) - - async def adj_roles(self, server, author, member: discord.Member=None, rrole_names=[], arole_names=[]): - # Thank you SML for the addrole code - # https://github.com/smlbiobot/SML-Cogs/tree/master/mm - - rroles = [r for r in server.roles if r.name in rrole_names] - aroles = [r for r in server.roles if r.name in arole_names] - try: - await self.bot.add_roles(member, *aroles) - await asyncio.sleep(0.5) - await self.bot.remove_roles(member, *rroles) - await asyncio.sleep(0.5) - - except discord.Forbidden: - await self.bot.say( - "{} does not have permission to edit {}’s roles.".format( - author.display_name, member.display_name)) - - except discord.HTTPException: - await self.bot.say( - "Failed to adjust roles.") - except: - await self.bot.say("Unknown Exception") - - - - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def iresort(self, ctx, member: discord.Member=None): - """Sends someone on vacation!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Member", "Immortal", "Eternal", "Phantom", "Ghost", "Undead", "Revenant", "Crypt", "Relocate", "Guest"] - arole_names = ["Resort"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Resort" in [r.name for r in member.roles]: - await self.bot.say("You are being sent on Vacation! :tada:" + - "Please relocate to Immortal Resort (#889L92UQ) when you find the time.") - await self.bot.send_message(member, "You are being sent on Vacation! :tada: Please relocate " + - "to Immortal Resort (#889L92UQ) when you find the time.\n" + - "You'll have limited access to the server until you rejoin a main clan") - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def icrypt(self, ctx, member: discord.Member=None): - """Sends someone to Crypt!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Immortal", "Eternal", "Ghost", "Phantom", "Revenant", "Undead", "Relocate", "Guest", "Resort"] - arole_names = ["Member", "Crypt"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Crypt" in [r.name for r in member.roles]: - await self.bot.say("Success") - await self.send_welcome(member) - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def irevenant(self, ctx, member: discord.Member=None): - """Sends someone to Revenant!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Immortal", "Eternal", "Ghost", "Phantom", "Undead", "Crypt", "Relocate", "Guest", "Resort"] - arole_names = ["Member", "Revenant"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Revenant" in [r.name for r in member.roles]: - await self.bot.say("Success") - await self.send_welcome(member) - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def iundead(self, ctx, member: discord.Member=None): - """Sends someone to Undead!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Immortal", "Eternal", "Ghost", "Phantom", "Revenant", "Crypt", "Relocate", "Guest", "Resort"] - arole_names = ["Member", "Undead"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Undead" in [r.name for r in member.roles]: - await self.bot.say("Success") - await self.send_welcome(member) - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def iphantom(self, ctx, member: discord.Member=None): - """Sends someone to Phantom!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Immortal", "Eternal", "Ghost", "Undead", "Revenant", "Crypt", "Relocate", "Guest", "Resort"] - arole_names = ["Member", "Phantom"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Phantom" in [r.name for r in member.roles]: - await self.bot.say("Success") - await self.send_welcome(member) - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def ieternal(self, ctx, member: discord.Member=None): - """Sends someone to Eternal!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Immortal", "Phantom", "Ghost", "Undead", "Revenant", "Crypt", "Relocate", "Guest", "Resort"] - arole_names = ["Member", "Eternal"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Eternal" in [r.name for r in member.roles]: - await self.bot.say("Success") - await self.send_welcome(member) - - @commands.command(pass_context=True, no_pm=True) - @checks.mod_or_permissions(manage_roles=True) - async def iimmortal(self, ctx, member: discord.Member=None): - """Sends someone to Immortal!""" - - if member is None: - await self.bot.send_cmd_help(ctx) - else: - server = ctx.message.server - author = ctx.message.author - role_names = ["Eternal", "Phantom", "Ghost", "Undead", "Revenant", "Crypt", "Relocate", "Guest", "Resort"] - arole_names = ["Member", "Immortal"] - await self.adj_roles(server, author, member, role_names, arole_names) - if "Immortal" in [r.name for r in member.roles]: - await self.bot.say("Success") - await self.send_welcome(member) - - @commands.group(aliases=['setimmortal'], pass_context=True, no_pm=True) - @checks.mod_or_permissions(administrator=True) - async def immortalset(self, ctx): - """Adjust immortal settings""" - - server = ctx.message.server - if server.id not in self.the_data: - self.the_data[server.id] = {} - self.save_data() - - if ctx.invoked_subcommand is None: - await self.bot.send_cmd_help(ctx) - - @immortalset.command(pass_context=True, no_pm=True) - async def welcomechannel(self, ctx): - server = ctx.message.server - if 'WELCOMECHANNEL' not in self.the_data[server.id]: - self.the_data[server.id]['WELCOMECHANNEL'] = '' - - self.the_data[server.id]['WELCOMECHANNEL'] = ctx.message.channel.id - self.save_data() - await self.bot.say("Welcome Channel set to "+ctx.message.channel.name) - - async def send_welcome(self, member): - server = member.server - if server.id in self.the_data: - await self.bot.send_message(server.get_channel(self.the_data[server.id]['WELCOMECHANNEL']), - "You now have access to the server, " + member.mention + "\n" + - "Check " + server.get_channel("257557008662790145").mention + " & " + - server.get_channel("257560603093106688").mention+" for clan rules etc.\n" + - "We recommend turning all message notifications on for " + server.get_channel("257560603093106688").mention + - " if you want to know when tourneys are posted and other important info.\n" + - "You can also type `!help` for a list of bot commands/features.") - -# @immortalset.command(pass_context=True) -# async def channel(self, ctx): -# server = ctx.message.server -# if 'channel' not in self.the_data[server.id]: -# self.the_data[server.id]['channel'] = '' - -# self.the_data[server.id]['channel'] = ctx.message.channel.id -# self.save_data() - -# async def _when_leave(self, member): -# server = member.server -# if server.id not in self.the_data: -# return - -# await self.bot.say("YOU LEFT ME "+member.mention) -# self.the_data[server.id] - - -def check_folders(): - if not os.path.exists("data/Fox-Cogs"): - print("Creating data/Fox-Cogs folder...") - os.makedirs("data/Fox-Cogs") - - if not os.path.exists("data/Fox-Cogs/immortal"): - print("Creating data/Fox-Cogs/immortal folder...") - os.makedirs("data/Fox-Cogs/immortal") - - -def check_files(): - if not dataIO.is_valid_json("data/Fox-Cogs/immortal/immortal.json"): - dataIO.save_json("data/Fox-Cogs/immortal/immortal.json", {}) - - -def setup(bot): - check_folders() - check_files() - q = Immortal(bot) - bot.add_cog(q) diff --git a/immortal/info.json b/immortal/info.json deleted file mode 100644 index 8668a65..0000000 --- a/immortal/info.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "AUTHOR" : "Bobloy", - "INSTALL_MSG" : "Thank you for installing Immortal Family Cog", - "NAME" : "Immortal", - "SHORT" : "Cog for a specific server, will not work on other servers", - "DESCRIPTION" : "Cog specifically for the Immortal Family discord server. I do not recommend installing it", - "TAGS" : ["fox", "bobloy", "utilities", "tools", "utility", "tool"], - "HIDDEN" : false -} \ No newline at end of file From 95837f8abf652ddb09f1143c6d0a02e50a624b67 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:10:19 -0400 Subject: [PATCH 22/50] More readme info --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de1d42d..6f1b1df 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,15 @@ Cog Function | Name | Status | Description (Click to see full status) | --- | --- | --- | -| ccrole | **Beta** |
Create custom commands that also assign rolesMay have some bugs, please create an issue if you find any
| +| ccrole | **Beta** |
Create custom commands that also assign roles`May have some bugs, please create an issue if you find any`
| | chatter | **Alpha** |
Chat-bot trained to talk like your guildMissing some key features, but currently functional
| | fight | **Incomplete** |
Organize bracket tournaments within discordStill in-progress, a massive project
| -| flag | **Beta** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| +| flag | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| | hangman | **Incomplete** |
Play a game of hangmanNot yet ported to v3
| -| immortal | **Private** |
Cog designed for a specific server, not recommended to installDesigned for a specific server, not recommended to install
| +| howdoi | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| | leaver | **Incomplete** |
Send a message in a channel when a user leaves the serverNot yet ported to v3
| | reactrestrict | **Alpha** |
Removes reactions by role per channelA bit clunky, but functional
| +| secrethitler | **Incomplete** |
Play the Secret Hitler gameConcept, no work done yet
| | stealemoji | **Alpha** |
Steals any custom emoji it sees in a reactionSome planned upgrades for server generation
| | werewolf | **Incomplete** |
Play the classic party game Werewolf within discordAnother massive project, will be fully customizable
| From 1d493b8e9db8f85e552ae8ebebd3ba15d6c4cd86 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:10:38 -0400 Subject: [PATCH 23/50] v3 initial commit --- hangman/__init__.py | 7 + hangman/hangman.py | 384 ++++++++++++++++++++------------------------ 2 files changed, 183 insertions(+), 208 deletions(-) create mode 100644 hangman/__init__.py diff --git a/hangman/__init__.py b/hangman/__init__.py new file mode 100644 index 0000000..aee87e2 --- /dev/null +++ b/hangman/__init__.py @@ -0,0 +1,7 @@ +from .hangman import Hangman + + +def setup(bot): + n = Hangman(bot) + bot.add_cog(n) + bot.add_listener(n._on_react, "on_reaction_add") \ No newline at end of file diff --git a/hangman/hangman.py b/hangman/hangman.py index 987b3a2..2b3776e 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -1,11 +1,11 @@ import discord import os +from collections import defaultdict from discord.ext import commands from random import randint -from .utils.dataIO import dataIO -from .utils import checks +from redbot.core import Config, checks, RedContext class Hangman: @@ -13,190 +13,187 @@ class Hangman: def __init__(self, bot): self.bot = bot - self.path = "data/Fox-Cogs/hangman" - self.file_path = "data/Fox-Cogs/hangman/hangman.json" - self.answer_path = "data/hangman/hanganswers.txt" - self.the_data = dataIO.load_json(self.file_path) - self.winbool = False + self.config = Config.get_conf(self, identifier=1049711010310997110) + default_guild = { + "theface": ':thinking:', + } + + self.config.register_guild(**default_guild) + + self.the_data = defaultdict(lambda:{"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) + self.answer_path = "hangman/data/hanganswers.txt" + self.winbool = defaultdict(lambda: False) + self.letters = "🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿" self.navigate = "🔼🔽" - self._updateHanglist() - - def _updateHanglist(self): - self.hanglist = ( - """> - \_________ - |/ - | - | - | - | - | - |\___ - """, - - """> - \_________ - |/ | - | - | - | - | - | - |\___ - H""", - - """> - \_________ - |/ | - | """+self.the_data["theface"]+""" - | - | - | - | - |\___ - HA""", - - """> - \________ - |/ | - | """+self.the_data["theface"]+""" - | | - | | - | - | - |\___ - HAN""", - - - """> - \_________ - |/ | - | """+self.the_data["theface"]+""" - | /| - | | - | - | - |\___ - HANG""", - - - """> - \_________ - |/ | - | """+self.the_data["theface"]+""" - | /|\ - | | - | - | - |\___ - HANGM""", - - - - """> - \________ - |/ | - | """+self.the_data["theface"]+""" - | /|\ - | | - | / - | - |\___ - HANGMA""", - - - """> - \________ - |/ | - | """+self.the_data["theface"]+""" - | /|\ - | | - | / \ - | - |\___ - HANGMAN""") - - def save_data(self): - """Saves the json""" - dataIO.save_json(self.file_path, self.the_data) - + + self.hanglist = {} + + async def _update_hanglist(self): + for guild in self.bot.guilds: + theface = await self.config.guild(guild).theface() + self.hanglist[guild] = ( + """> + \_________ + |/ + | + | + | + | + | + |\___ + """, + + """> + \_________ + |/ | + | + | + | + | + | + |\___ + H""", + + """> + \_________ + |/ | + | """+theface+""" + | + | + | + | + |\___ + HA""", + + """> + \________ + |/ | + | """+theface+""" + | | + | | + | + | + |\___ + HAN""", + + + """> + \_________ + |/ | + | """+theface+""" + | /| + | | + | + | + |\___ + HANG""", + + + """> + \_________ + |/ | + | """+theface+""" + | /|\ + | | + | + | + |\___ + HANGM""", + + + + """> + \________ + |/ | + | """+theface+""" + | /|\ + | | + | / + | + |\___ + HANGMA""", + + + """> + \________ + |/ | + | """+theface+""" + | /|\ + | | + | / \ + | + |\___ + HANGMAN""") + @commands.group(aliases=['sethang'], pass_context=True) @checks.mod_or_permissions(administrator=True) async def hangset(self, ctx): """Adjust hangman settings""" - if ctx.invoked_subcommand is None: - await self.bot.send_cmd_help(ctx) - + if not ctx.invoked_subcommand: + await ctx.send_help() + @hangset.command(pass_context=True) - async def face(self, ctx, theface): + async def face(self, ctx: commands.Context, theface): message = ctx.message #Borrowing FlapJack's emoji validation (https://github.com/flapjax/FlapJack-Cogs/blob/master/smartreact/smartreact.py) if theface[:2] == "<:": - theface = [r for server in self.bot.servers for r in server.emojis if r.id == theface.split(':')[2][:-1]][0] - + theface = [r for r in self.bot.emojis if r.id == theface.split(':')[2][:-1]][0] + try: # Use the face as reaction to see if it's valid (THANKS FLAPJACK <3) - await self.bot.add_reaction(message, theface) - self.the_data["theface"] = str(theface) - self.save_data() - self._updateHanglist() - await self.bot.say("Face has been updated!") - + await message.add_reaction(theface) except discord.errors.HTTPException: - await self.bot.say("That's not an emoji I recognize.") + await ctx.send("That's not an emoji I recognize.") + return + + await self.config.guild(ctx.guild).theface.set(theface) + await self._update_hanglist() + await ctx.send("Face has been updated!") @commands.command(aliases=['hang'], pass_context=True) async def hangman(self, ctx, guess: str=None): """Play a game of hangman against the bot!""" if guess is None: - if self.the_data["running"]: - await self.bot.say("Game of hangman is already running!\nEnter your guess!") - self._printgame() + if self.the_data[ctx.guild]["running"]: + await ctx.send("Game of hangman is already running!\nEnter your guess!") + self._printgame(ctx.channel) """await self.bot.send_cmd_help(ctx)""" else: - await self.bot.say("Starting a game of hangman!") - self._startgame() - await self._printgame() - elif not self.the_data["running"]: - await self.bot.say("Game of hangman is not yet running!\nStarting a game of hangman!") - self._startgame() - await self._printgame() + await ctx.send("Starting a game of hangman!") + self._startgame(ctx.guild) + await self._printgame(ctx.channel) + elif not self.the_data[ctx.guild]["running"]: + await ctx.send("Game of hangman is not yet running!\nStarting a game of hangman!") + self._startgame(ctx.guild) + await self._printgame(ctx.channel) else: - await self._guessletter(guess) + await self._guessletter(guess, ctx.channel) - - def _startgame(self): + def _startgame(self, guild): """Starts a new game of hangman""" - self.the_data["answer"] = self._getphrase().upper() - self.the_data["hangman"] = 0 - self.the_data["guesses"] = [] - self.winbool = False - self.the_data["running"] = True - self.the_data["trackmessage"] = False - self.save_data() + self.the_data[guild]["answer"] = self._getphrase().upper() + self.the_data[guild]["hangman"] = 0 + self.the_data[guild]["guesses"] = [] + self.winbool[guild] = False + self.the_data[guild]["running"] = True + self.the_data[guild]["trackmessage"] = False - def _stopgame(self): + def _stopgame(self, guild): """Stops the game in current state""" - self.the_data["running"] = False - self.save_data() - - async def _checkdone(self, channel=None): - if self.winbool: - if channel: - await self.bot.send_message(channel, "You Win!") - else: - await self.bot.say("You Win!") - self._stopgame() - - if self.the_data["hangman"] >= 7: - if channel: - await self.bot.send_message(channel, "You Lose!\nThe Answer was: **"+self.the_data["answer"]+"**") - else: - await self.bot.say("You Lose!\nThe Answer was: **"+self.the_data["answer"]+"**") + self.the_data[guild]["running"] = False + + async def _checkdone(self, channel): + if self.winbool[channel.guild]: + await channel.send("You Win!") + self._stopgame(channel.guild) + return - self._stopgame() + if self.the_data[channel.guild]["hangman"] >= 7: + await channel.send("You Lose!\nThe Answer was: **"+self.the_data[channel.guild]["answer"]+"**") + + self._stopgame(channel.guild) def _getphrase(self): """Get a new phrase for the game and returns it""" @@ -206,7 +203,6 @@ class Hangman: outphrase = "" while outphrase == "": outphrase = phrases[randint(0, len(phrases)-1)].partition(" (")[0] -# outphrase = phrases[randint(0,10)].partition(" (")[0] return outphrase def _hideanswer(self): @@ -234,27 +230,19 @@ class Hangman: return out_str - async def _guessletter(self, guess, channel=None): + async def _guessletter(self, guess, channel): """Checks the guess on a letter and prints game if acceptable guess""" - if not guess.upper() in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" or not len(guess) == 1: - if channel: - await self.bot.send_message(channel, "Invalid guess. Only A-Z is accepted") - else: - await self.bot.say("Invalid guess. Only A-Z is accepted") + if guess.upper() not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" or len(guess) != 1: + await channel.send("Invalid guess. Only A-Z is accepted") return - if guess.upper() in self.the_data["guesses"]: - if channel: - await self.bot.send_message(channel, "Already guessed that! Try again") - else: - await self.bot.say("Already guessed that! Try again") + if guess.upper() in self.the_data[channel.guild]["guesses"]: + await channel.send("Already guessed that! Try again") return - - if not guess.upper() in self.the_data["answer"]: + if guess.upper() not in self.the_data[channel.guild]["answer"]: self.the_data["hangman"] += 1 - self.the_data["guesses"].append(guess.upper()) - self.save_data() + self.the_data[channel.guild]["guesses"].append(guess.upper()) await self._printgame(channel) @@ -290,66 +278,46 @@ class Hangman: async def _reactmessage_menu(self, message): """React with menu options""" - await self.bot.clear_reactions(message) + await message.clear_reactions() - await self.bot.add_reaction(message, self.navigate[0]) - await self.bot.add_reaction(message, self.navigate[-1]) + await message.add_reaction(self.navigate[0]) + await message.add_reaction(self.navigate[-1]) async def _reactmessage_am(self, message): - await self.bot.clear_reactions(message) + await message.clear_reactions() for x in range(len(self.letters)): if x in [i for i,b in enumerate("ABCDEFGHIJKLM") if b not in self._guesslist()]: - await self.bot.add_reaction(message, self.letters[x]) + await message.add_reaction(self.letters[x]) - await self.bot.add_reaction(message, self.navigate[-1]) - + await message.add_reaction(self.navigate[-1]) async def _reactmessage_nz(self, message): await self.bot.clear_reactions(message) for x in range(len(self.letters)): if x in [i for i,b in enumerate("NOPQRSTUVWXYZ") if b not in self._guesslist()]: - await self.bot.add_reaction(message, self.letters[x+13]) + await message.add_reaction(self.letters[x+13]) - await self.bot.add_reaction(message, self.navigate[0]) + await message.add_reaction(self.navigate[0]) - async def _printgame(self, channel=None): + async def _printgame(self, channel): """Print the current state of game""" cSay = ("Guess this: " + str(self._hideanswer()) + "\n" + "Used Letters: " + str(self._guesslist()) + "\n" + self.hanglist[self.the_data["hangman"]] + "\n" + self.navigate[0]+" for A-M, "+self.navigate[-1]+" for N-Z") - if channel: - message = await self.bot.send_message(channel, cSay) - else: - message = await self.bot.say(cSay) - + + message = await channel.send(cSay) + self.the_data["trackmessage"] = message.id - self.save_data() + await self._reactmessage_menu(message) await self._checkdone(channel) - -def check_folders(): - if not os.path.exists("data/Fox-Cogs"): - print("Creating data/Fox-Cogs folder...") - os.makedirs("data/Fox-Cogs") - - if not os.path.exists("data/Fox-Cogs/hangman"): - print("Creating data/Fox-Cogs/hangman folder...") - os.makedirs("data/Fox-Cogs/hangman") - - -def check_files(): - if not dataIO.is_valid_json("data/Fox-Cogs/hangman/hangman.json"): - dataIO.save_json("data/Fox-Cogs/hangman/hangman.json", {"running": False, "hangman": 0, "guesses": [], "theface": "<:never:336861463446814720>", "trackmessage": False}) - def setup(bot): - check_folders() - check_files() n = Hangman(bot) bot.add_cog(n) bot.add_listener(n._on_react, "on_reaction_add") From 601c362308e5369303f80b29cc1528fd320801a0 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:13:41 -0400 Subject: [PATCH 24/50] info update --- hangman/info.json | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/hangman/info.json b/hangman/info.json index ac146f1..d845d0f 100644 --- a/hangman/info.json +++ b/hangman/info.json @@ -1,14 +1,20 @@ { - "AUTHOR": "Bobloy", - "DESCRIPTION": "Hangman Cog for Red Discord bot. Play a game of Hangman with your friends!", - "INSTALL_MSG": "Thank you for installing Hangman! Play with [p]hangman, edit with [p]hangset", - "NAME": "Hangman", - "SHORT": "Play a game of Hangman with your friends!", - "TAGS": [ - "fox", - "bobloy", - "fun", - "game" - ], - "HIDDEN": false + "author": [ + "Bobloy" + ], + "bot_version": [ + 3, + 0, + 0 + ], + "description": "Play Hangman with your friends", + "hidden": false, + "install_msg": "Thank you for installing Hangman!", + "requirements": [], + "short": "Play Hangman", + "tags": [ + "game", + "fun", + "bobloy" + ] } \ No newline at end of file From d88e8040d75c7378051f73ed793798a6a1bda3c0 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:20:47 -0400 Subject: [PATCH 25/50] reformat pep8 --- hangman/__init__.py | 2 +- hangman/hangman.py | 109 +++++++++++++++++++------------------------- hangman/info.json | 2 +- 3 files changed, 50 insertions(+), 63 deletions(-) diff --git a/hangman/__init__.py b/hangman/__init__.py index aee87e2..8b6ec76 100644 --- a/hangman/__init__.py +++ b/hangman/__init__.py @@ -4,4 +4,4 @@ from .hangman import Hangman def setup(bot): n = Hangman(bot) bot.add_cog(n) - bot.add_listener(n._on_react, "on_reaction_add") \ No newline at end of file + bot.add_listener(n._on_react, "on_reaction_add") diff --git a/hangman/hangman.py b/hangman/hangman.py index 2b3776e..7e6376d 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -1,11 +1,9 @@ -import discord -import os - from collections import defaultdict -from discord.ext import commands from random import randint -from redbot.core import Config, checks, RedContext +import discord +from discord.ext import commands +from redbot.core import Config, checks class Hangman: @@ -20,7 +18,8 @@ class Hangman: self.config.register_guild(**default_guild) - self.the_data = defaultdict(lambda:{"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) + self.the_data = defaultdict( + lambda: {"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) self.answer_path = "hangman/data/hanganswers.txt" self.winbool = defaultdict(lambda: False) @@ -58,7 +57,7 @@ class Hangman: """> \_________ |/ | - | """+theface+""" + | """ + theface + """ | | | @@ -69,7 +68,7 @@ class Hangman: """> \________ |/ | - | """+theface+""" + | """ + theface + """ | | | | | @@ -77,11 +76,10 @@ class Hangman: |\___ HAN""", - """> \_________ |/ | - | """+theface+""" + | """ + theface + """ | /| | | | @@ -89,11 +87,10 @@ class Hangman: |\___ HANG""", - """> \_________ |/ | - | """+theface+""" + | """ + theface + """ | /|\ | | | @@ -101,12 +98,10 @@ class Hangman: |\___ HANGM""", - - """> \________ |/ | - | """+theface+""" + | """ + theface + """ | /|\ | | | / @@ -114,11 +109,10 @@ class Hangman: |\___ HANGMA""", - """> \________ |/ | - | """+theface+""" + | """ + theface + """ | /|\ | | | / \ @@ -136,7 +130,7 @@ class Hangman: @hangset.command(pass_context=True) async def face(self, ctx: commands.Context, theface): message = ctx.message - #Borrowing FlapJack's emoji validation (https://github.com/flapjax/FlapJack-Cogs/blob/master/smartreact/smartreact.py) + # Borrowing FlapJack's emoji validation (https://github.com/flapjax/FlapJack-Cogs/blob/master/smartreact/smartreact.py) if theface[:2] == "<:": theface = [r for r in self.bot.emojis if r.id == theface.split(':')[2][:-1]][0] @@ -150,9 +144,9 @@ class Hangman: await self.config.guild(ctx.guild).theface.set(theface) await self._update_hanglist() await ctx.send("Face has been updated!") - + @commands.command(aliases=['hang'], pass_context=True) - async def hangman(self, ctx, guess: str=None): + async def hangman(self, ctx, guess: str = None): """Play a game of hangman against the bot!""" if guess is None: if self.the_data[ctx.guild]["running"]: @@ -167,10 +161,9 @@ class Hangman: await ctx.send("Game of hangman is not yet running!\nStarting a game of hangman!") self._startgame(ctx.guild) await self._printgame(ctx.channel) - else: + else: await self._guessletter(guess, ctx.channel) - def _startgame(self, guild): """Starts a new game of hangman""" self.the_data[guild]["answer"] = self._getphrase().upper() @@ -179,7 +172,7 @@ class Hangman: self.winbool[guild] = False self.the_data[guild]["running"] = True self.the_data[guild]["trackmessage"] = False - + def _stopgame(self, guild): """Stops the game in current state""" self.the_data[guild]["running"] = False @@ -189,47 +182,47 @@ class Hangman: await channel.send("You Win!") self._stopgame(channel.guild) return - + if self.the_data[channel.guild]["hangman"] >= 7: - await channel.send("You Lose!\nThe Answer was: **"+self.the_data[channel.guild]["answer"]+"**") + await channel.send("You Lose!\nThe Answer was: **" + self.the_data[channel.guild]["answer"] + "**") self._stopgame(channel.guild) - + def _getphrase(self): """Get a new phrase for the game and returns it""" phrasefile = open(self.answer_path, 'r') phrases = phrasefile.readlines() - + outphrase = "" while outphrase == "": - outphrase = phrases[randint(0, len(phrases)-1)].partition(" (")[0] + outphrase = phrases[randint(0, len(phrases) - 1)].partition(" (")[0] return outphrase - + def _hideanswer(self): """Returns the obscured answer""" out_str = "" - + self.winbool = True for i in self.the_data["answer"]: if i == " " or i == "-": - out_str += i*2 + out_str += i * 2 elif i in self.the_data["guesses"] or i not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": - out_str += "__"+i+"__ " + out_str += "__" + i + "__ " else: out_str += "**\_** " self.winbool = False - + return out_str - + def _guesslist(self): """Returns the current letter list""" out_str = "" for i in self.the_data["guesses"]: out_str += str(i) + "," out_str = out_str[:-1] - + return out_str - + async def _guessletter(self, guess, channel): """Checks the guess on a letter and prints game if acceptable guess""" if guess.upper() not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" or len(guess) != 1: @@ -241,73 +234,68 @@ class Hangman: return if guess.upper() not in self.the_data[channel.guild]["answer"]: self.the_data["hangman"] += 1 - + self.the_data[channel.guild]["guesses"].append(guess.upper()) - + await self._printgame(channel) - + async def _on_react(self, reaction, user): """ Thanks to flapjack reactpoll for guidelines https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py""" - - - + if not self.the_data["trackmessage"]: return - + if user == self.bot.user: return # Don't remove bot's own reactions message = reaction.message emoji = reaction.emoji - + if not message.id == self.the_data["trackmessage"]: return - + if str(emoji) in self.letters: letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[self.letters.index(str(emoji))] await self._guessletter(letter, message.channel) - - + if str(emoji) in self.navigate: if str(emoji) == self.navigate[0]: await self._reactmessage_am(message) - + if str(emoji) == self.navigate[-1]: await self._reactmessage_nz(message) - - + async def _reactmessage_menu(self, message): """React with menu options""" await message.clear_reactions() - + await message.add_reaction(self.navigate[0]) await message.add_reaction(self.navigate[-1]) - + async def _reactmessage_am(self, message): await message.clear_reactions() for x in range(len(self.letters)): - if x in [i for i,b in enumerate("ABCDEFGHIJKLM") if b not in self._guesslist()]: + if x in [i for i, b in enumerate("ABCDEFGHIJKLM") if b not in self._guesslist()]: await message.add_reaction(self.letters[x]) - + await message.add_reaction(self.navigate[-1]) async def _reactmessage_nz(self, message): await self.bot.clear_reactions(message) for x in range(len(self.letters)): - if x in [i for i,b in enumerate("NOPQRSTUVWXYZ") if b not in self._guesslist()]: - await message.add_reaction(self.letters[x+13]) - - await message.add_reaction(self.navigate[0]) + if x in [i for i, b in enumerate("NOPQRSTUVWXYZ") if b not in self._guesslist()]: + await message.add_reaction(self.letters[x + 13]) + await message.add_reaction(self.navigate[0]) async def _printgame(self, channel): """Print the current state of game""" cSay = ("Guess this: " + str(self._hideanswer()) + "\n" + "Used Letters: " + str(self._guesslist()) + "\n" + self.hanglist[self.the_data["hangman"]] + "\n" - + self.navigate[0]+" for A-M, "+self.navigate[-1]+" for N-Z") + + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") message = await channel.send(cSay) @@ -315,10 +303,9 @@ class Hangman: await self._reactmessage_menu(message) await self._checkdone(channel) - + def setup(bot): n = Hangman(bot) bot.add_cog(n) bot.add_listener(n._on_react, "on_reaction_add") - diff --git a/hangman/info.json b/hangman/info.json index d845d0f..655f00c 100644 --- a/hangman/info.json +++ b/hangman/info.json @@ -14,7 +14,7 @@ "short": "Play Hangman", "tags": [ "game", - "fun", + "fun", "bobloy" ] } \ No newline at end of file From 8379bd1572bdea3c4d1d6f0b1aefb283a64efe75 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:27:59 -0400 Subject: [PATCH 26/50] more guild nonsense --- hangman/hangman.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 7e6376d..695df84 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -198,26 +198,26 @@ class Hangman: outphrase = phrases[randint(0, len(phrases) - 1)].partition(" (")[0] return outphrase - def _hideanswer(self): + def _hideanswer(self, guild): """Returns the obscured answer""" out_str = "" self.winbool = True - for i in self.the_data["answer"]: + for i in self.the_data[guild]["answer"]: if i == " " or i == "-": out_str += i * 2 - elif i in self.the_data["guesses"] or i not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": + elif i in self.the_data[guild]["guesses"] or i not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": out_str += "__" + i + "__ " else: out_str += "**\_** " - self.winbool = False + self.winbool[guild] = False return out_str - def _guesslist(self): + def _guesslist(self, guild): """Returns the current letter list""" out_str = "" - for i in self.the_data["guesses"]: + for i in self.the_data[guild]["guesses"]: out_str += str(i) + "," out_str = out_str[:-1] @@ -233,7 +233,7 @@ class Hangman: await channel.send("Already guessed that! Try again") return if guess.upper() not in self.the_data[channel.guild]["answer"]: - self.the_data["hangman"] += 1 + self.the_data[channel.guild]["hangman"] += 1 self.the_data[channel.guild]["guesses"].append(guess.upper()) @@ -243,7 +243,7 @@ class Hangman: """ Thanks to flapjack reactpoll for guidelines https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py""" - if not self.the_data["trackmessage"]: + if reaction.message.id != self.the_data[user.guild]["trackmessage"]: return if user == self.bot.user: @@ -251,9 +251,6 @@ class Hangman: message = reaction.message emoji = reaction.emoji - if not message.id == self.the_data["trackmessage"]: - return - if str(emoji) in self.letters: letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[self.letters.index(str(emoji))] await self._guessletter(letter, message.channel) @@ -292,14 +289,14 @@ class Hangman: async def _printgame(self, channel): """Print the current state of game""" - cSay = ("Guess this: " + str(self._hideanswer()) + "\n" - + "Used Letters: " + str(self._guesslist()) + "\n" - + self.hanglist[self.the_data["hangman"]] + "\n" + cSay = ("Guess this: " + str(self._hideanswer(channel.guild)) + "\n" + + "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" + + self.hanglist[self.the_data[channel.guild]["hangman"]] + "\n" + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") message = await channel.send(cSay) - self.the_data["trackmessage"] = message.id + self.the_data[channel.guild]["trackmessage"] = message.id await self._reactmessage_menu(message) await self._checkdone(channel) From 619b62336f3d14fbd558c853a38dae454dd5d75b Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:30:15 -0400 Subject: [PATCH 27/50] more guild --- hangman/hangman.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 695df84..3e25c22 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -130,7 +130,8 @@ class Hangman: @hangset.command(pass_context=True) async def face(self, ctx: commands.Context, theface): message = ctx.message - # Borrowing FlapJack's emoji validation (https://github.com/flapjax/FlapJack-Cogs/blob/master/smartreact/smartreact.py) + # Borrowing FlapJack's emoji validation + # (https://github.com/flapjax/FlapJack-Cogs/blob/master/smartreact/smartreact.py) if theface[:2] == "<:": theface = [r for r in self.bot.emojis if r.id == theface.split(':')[2][:-1]][0] @@ -202,7 +203,7 @@ class Hangman: """Returns the obscured answer""" out_str = "" - self.winbool = True + self.winbool[guild] = True for i in self.the_data[guild]["answer"]: if i == " " or i == "-": out_str += i * 2 @@ -273,7 +274,7 @@ class Hangman: await message.clear_reactions() for x in range(len(self.letters)): - if x in [i for i, b in enumerate("ABCDEFGHIJKLM") if b not in self._guesslist()]: + if x in [i for i, b in enumerate("ABCDEFGHIJKLM") if b not in self._guesslist(message.guild)]: await message.add_reaction(self.letters[x]) await message.add_reaction(self.navigate[-1]) @@ -282,19 +283,19 @@ class Hangman: await self.bot.clear_reactions(message) for x in range(len(self.letters)): - if x in [i for i, b in enumerate("NOPQRSTUVWXYZ") if b not in self._guesslist()]: + if x in [i for i, b in enumerate("NOPQRSTUVWXYZ") if b not in self._guesslist(message.guild)]: await message.add_reaction(self.letters[x + 13]) await message.add_reaction(self.navigate[0]) async def _printgame(self, channel): """Print the current state of game""" - cSay = ("Guess this: " + str(self._hideanswer(channel.guild)) + "\n" - + "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" - + self.hanglist[self.the_data[channel.guild]["hangman"]] + "\n" - + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") + c_say = ("Guess this: " + str(self._hideanswer(channel.guild)) + "\n" + + "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" + + self.hanglist[self.the_data[channel.guild]["hangman"]] + "\n" + + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") - message = await channel.send(cSay) + message = await channel.send(c_say) self.the_data[channel.guild]["trackmessage"] = message.id From 86985476e2d6c697fdc851907918b190d841e4d9 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:35:15 -0400 Subject: [PATCH 28/50] better navigate? --- hangman/hangman.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 3e25c22..8a6e0aa 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -8,6 +8,8 @@ from redbot.core import Config, checks class Hangman: """Lets anyone play a game of hangman with custom phrases""" + navigate = "🔼🔽" + letters = "🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿" def __init__(self, bot): self.bot = bot @@ -23,9 +25,6 @@ class Hangman: self.answer_path = "hangman/data/hanganswers.txt" self.winbool = defaultdict(lambda: False) - self.letters = "🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿" - self.navigate = "🔼🔽" - self.hanglist = {} async def _update_hanglist(self): @@ -290,10 +289,10 @@ class Hangman: async def _printgame(self, channel): """Print the current state of game""" - c_say = ("Guess this: " + str(self._hideanswer(channel.guild)) + "\n" - + "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" - + self.hanglist[self.the_data[channel.guild]["hangman"]] + "\n" - + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") + c_say =("Guess this: " + str(self._hideanswer(channel.guild)) + "\n" + + "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" + + self.hanglist[self.the_data[channel.guild]["hangman"]] + "\n" + + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") message = await channel.send(c_say) From 79b5b6155caaf4884434c291f87301a6d0a341f5 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:40:39 -0400 Subject: [PATCH 29/50] clearer errors --- hangman/hangman.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 8a6e0aa..c156136 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -289,10 +289,16 @@ class Hangman: async def _printgame(self, channel): """Print the current state of game""" - c_say =("Guess this: " + str(self._hideanswer(channel.guild)) + "\n" - + "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" - + self.hanglist[self.the_data[channel.guild]["hangman"]] + "\n" - + self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z") + if channel.guild not in self.hanglist: + await self._update_hanglist() + + c_say ="Guess this: " + str(self._hideanswer(channel.guild)) + "\n" + + c_say += "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" + + c_say += self.hanglist[channel.guild[self.the_data[channel.guild]["hangman"]]] + "\n" + + c_say += self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z" message = await channel.send(c_say) From a9609516edd9f4843e65a3be53e6e4bd2ca98fbe Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:41:25 -0400 Subject: [PATCH 30/50] await co --- hangman/hangman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index c156136..e159f2e 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -151,7 +151,7 @@ class Hangman: if guess is None: if self.the_data[ctx.guild]["running"]: await ctx.send("Game of hangman is already running!\nEnter your guess!") - self._printgame(ctx.channel) + await self._printgame(ctx.channel) """await self.bot.send_cmd_help(ctx)""" else: await ctx.send("Starting a game of hangman!") From 03fcab9817884abda6acddce56cffabb6397926c Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:42:09 -0400 Subject: [PATCH 31/50] even better use of brackets --- hangman/hangman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index e159f2e..502dfb5 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -296,7 +296,7 @@ class Hangman: c_say += "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" - c_say += self.hanglist[channel.guild[self.the_data[channel.guild]["hangman"]]] + "\n" + c_say += self.hanglist[channel.guild][self.the_data[channel.guild]["hangman"]] + "\n" c_say += self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z" From 77ca0e2891e6ba450061f64c1cd4c38bdaf2175f Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:44:29 -0400 Subject: [PATCH 32/50] v3 --- hangman/hangman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 502dfb5..563e7ee 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -279,7 +279,7 @@ class Hangman: await message.add_reaction(self.navigate[-1]) async def _reactmessage_nz(self, message): - await self.bot.clear_reactions(message) + await message.clear_reactions() for x in range(len(self.letters)): if x in [i for i, b in enumerate("NOPQRSTUVWXYZ") if b not in self._guesslist(message.guild)]: From 175586dfacf5116a79121815d45517756d8a15f9 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 16:53:57 -0400 Subject: [PATCH 33/50] make_say, reprint game --- hangman/hangman.py | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 563e7ee..0e1da72 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -223,8 +223,9 @@ class Hangman: return out_str - async def _guessletter(self, guess, channel): + async def _guessletter(self, guess, message): """Checks the guess on a letter and prints game if acceptable guess""" + channel = message.channel if guess.upper() not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" or len(guess) != 1: await channel.send("Invalid guess. Only A-Z is accepted") return @@ -237,7 +238,7 @@ class Hangman: self.the_data[channel.guild]["guesses"].append(guess.upper()) - await self._printgame(channel) + await self._reprintgame(message) async def _on_react(self, reaction, user): """ Thanks to flapjack reactpoll for guidelines @@ -254,6 +255,8 @@ class Hangman: if str(emoji) in self.letters: letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[self.letters.index(str(emoji))] await self._guessletter(letter, message.channel) + await message.remove_reaction(emoji, user) + await message.remove_reaction(emoji, self.bot.user) if str(emoji) in self.navigate: if str(emoji) == self.navigate[0]: @@ -287,18 +290,34 @@ class Hangman: await message.add_reaction(self.navigate[0]) - async def _printgame(self, channel): - """Print the current state of game""" - if channel.guild not in self.hanglist: + def _make_say(self, guild): + c_say = "Guess this: " + str(self._hideanswer(guild)) + "\n" + + c_say += "Used Letters: " + str(self._guesslist(guild)) + "\n" + + c_say += self.hanglist[guild][self.the_data[guild]["hangman"]] + "\n" + + c_say += self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z" + + return c_say + + async def _reprintgame(self, message): + if message.guild not in self.hanglist: await self._update_hanglist() - c_say ="Guess this: " + str(self._hideanswer(channel.guild)) + "\n" + c_say = self._make_say(message.guild) - c_say += "Used Letters: " + str(self._guesslist(channel.guild)) + "\n" + await message.edit(c_say) + self.the_data[message.guild]["trackmessage"] = message.id - c_say += self.hanglist[channel.guild][self.the_data[channel.guild]["hangman"]] + "\n" + await self._checkdone(message.channel) - c_say += self.navigate[0] + " for A-M, " + self.navigate[-1] + " for N-Z" + async def _printgame(self, channel): + """Print the current state of game""" + if channel.guild not in self.hanglist: + await self._update_hanglist() + + c_say = self._make_say(channel.guild) message = await channel.send(c_say) From 8db4d7f6639b3c31822ec41e2398d4ac008fdb8a Mon Sep 17 00:00:00 2001 From: Bobloy Date: Thu, 3 May 2018 17:05:17 -0400 Subject: [PATCH 34/50] correct guesses --- hangman/hangman.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 0e1da72..bea9ded 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -162,7 +162,8 @@ class Hangman: self._startgame(ctx.guild) await self._printgame(ctx.channel) else: - await self._guessletter(guess, ctx.channel) + await ctx.send("Guess by reacting to the message") + # await self._guessletter(guess, ctx.channel) def _startgame(self, guild): """Starts a new game of hangman""" @@ -254,7 +255,7 @@ class Hangman: if str(emoji) in self.letters: letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[self.letters.index(str(emoji))] - await self._guessletter(letter, message.channel) + await self._guessletter(letter, message) await message.remove_reaction(emoji, user) await message.remove_reaction(emoji, self.bot.user) From 9bb1d9ca5a69dcaceed49f33baada34153630c7f Mon Sep 17 00:00:00 2001 From: Bobloy Date: Fri, 4 May 2018 13:12:53 -0400 Subject: [PATCH 35/50] path? --- hangman/hangman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index bea9ded..00424e0 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -22,7 +22,7 @@ class Hangman: self.the_data = defaultdict( lambda: {"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) - self.answer_path = "hangman/data/hanganswers.txt" + self.answer_path = ".data/hanganswers.txt" self.winbool = defaultdict(lambda: False) self.hanglist = {} From ef81693050111c535e260ead5d46c35974f0eba8 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Fri, 4 May 2018 13:18:08 -0400 Subject: [PATCH 36/50] ? --- hangman/hangman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 00424e0..d502296 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -22,7 +22,7 @@ class Hangman: self.the_data = defaultdict( lambda: {"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) - self.answer_path = ".data/hanganswers.txt" + self.answer_path = "./data/hanganswers.txt" self.winbool = defaultdict(lambda: False) self.hanglist = {} From 81bba03affac1c9fcdbb47768c61d575f0697ce0 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Fri, 4 May 2018 15:23:27 -0400 Subject: [PATCH 37/50] closer than ever --- hangman/__init__.py | 2 ++ hangman/hangman.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hangman/__init__.py b/hangman/__init__.py index 8b6ec76..2168fdf 100644 --- a/hangman/__init__.py +++ b/hangman/__init__.py @@ -1,7 +1,9 @@ from .hangman import Hangman +from redbot.core import data_manager def setup(bot): n = Hangman(bot) + data_manager.load_bundled_data(n, __file__) bot.add_cog(n) bot.add_listener(n._on_react, "on_reaction_add") diff --git a/hangman/hangman.py b/hangman/hangman.py index d502296..faa90bf 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -4,6 +4,7 @@ from random import randint import discord from discord.ext import commands from redbot.core import Config, checks +from redbot.core.data_manager import cog_data_path, load_basic_configuration class Hangman: @@ -13,6 +14,7 @@ class Hangman: def __init__(self, bot): self.bot = bot + load_basic_configuration("hangman") self.config = Config.get_conf(self, identifier=1049711010310997110) default_guild = { "theface": ':thinking:', @@ -22,7 +24,7 @@ class Hangman: self.the_data = defaultdict( lambda: {"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) - self.answer_path = "./data/hanganswers.txt" + self.answer_path = "/hanganswers.txt" self.winbool = defaultdict(lambda: False) self.hanglist = {} @@ -191,8 +193,9 @@ class Hangman: def _getphrase(self): """Get a new phrase for the game and returns it""" - phrasefile = open(self.answer_path, 'r') - phrases = phrasefile.readlines() + + with cog_data_path("hangman").open('r') as phrasefile: + phrases = phrasefile.readlines() outphrase = "" while outphrase == "": From 03d74f24fc8debf93f6d10b964030adaf4eb40da Mon Sep 17 00:00:00 2001 From: Bobloy Date: Fri, 4 May 2018 17:01:56 -0400 Subject: [PATCH 38/50] more attempts --- hangman/hangman.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index faa90bf..60e4589 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -193,8 +193,11 @@ class Hangman: def _getphrase(self): """Get a new phrase for the game and returns it""" + openpath = cog_data_path("hangman") - with cog_data_path("hangman").open('r') as phrasefile: + openpath = openpath.joinpath("data") + + with openpath.open('r') as phrasefile: phrases = phrasefile.readlines() outphrase = "" From 0291bd9904c4eae3cc324fe9d81359ac95342197 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 7 May 2018 13:18:12 -0400 Subject: [PATCH 39/50] almost there --- hangman/hangman.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hangman/hangman.py b/hangman/hangman.py index 60e4589..766177f 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -14,7 +14,6 @@ class Hangman: def __init__(self, bot): self.bot = bot - load_basic_configuration("hangman") self.config = Config.get_conf(self, identifier=1049711010310997110) default_guild = { "theface": ':thinking:', @@ -24,7 +23,10 @@ class Hangman: self.the_data = defaultdict( lambda: {"running": False, "hangman": 0, "guesses": [], "trackmessage": False, "answer": ''}) - self.answer_path = "/hanganswers.txt" + self.path = str(cog_data_path(self)).replace('\\', '/') + + self.answer_path = self.path+"/bundled_data/hanganswers.txt" + self.winbool = defaultdict(lambda: False) self.hanglist = {} @@ -179,25 +181,21 @@ class Hangman: def _stopgame(self, guild): """Stops the game in current state""" self.the_data[guild]["running"] = False + self.the_data[guild]["trackmessage"] = False async def _checkdone(self, channel): if self.winbool[channel.guild]: await channel.send("You Win!") self._stopgame(channel.guild) - return - - if self.the_data[channel.guild]["hangman"] >= 7: + elif self.the_data[channel.guild]["hangman"] >= 7: await channel.send("You Lose!\nThe Answer was: **" + self.the_data[channel.guild]["answer"] + "**") self._stopgame(channel.guild) def _getphrase(self): """Get a new phrase for the game and returns it""" - openpath = cog_data_path("hangman") - - openpath = openpath.joinpath("data") - with openpath.open('r') as phrasefile: + with open(self.answer_path, 'r') as phrasefile: phrases = phrasefile.readlines() outphrase = "" @@ -314,7 +312,7 @@ class Hangman: c_say = self._make_say(message.guild) - await message.edit(c_say) + await message.edit(content=c_say) self.the_data[message.guild]["trackmessage"] = message.id await self._checkdone(message.channel) From 72882f705f31cd5527e86bccda6ee036c1ea05ce Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 7 May 2018 15:46:00 -0400 Subject: [PATCH 40/50] Hangman is alpha --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f1b1df..932bbac 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Cog Function | chatter | **Alpha** |
Chat-bot trained to talk like your guildMissing some key features, but currently functional
| | fight | **Incomplete** |
Organize bracket tournaments within discordStill in-progress, a massive project
| | flag | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| -| hangman | **Incomplete** |
Play a game of hangmanNot yet ported to v3
| +| hangman | **Alpha** |
Play a game of hangmanSome visual glitches and needs more customization
| | howdoi | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| | leaver | **Incomplete** |
Send a message in a channel when a user leaves the serverNot yet ported to v3
| | reactrestrict | **Alpha** |
Removes reactions by role per channelA bit clunky, but functional
| From f820e44425eb3487ee189632d10b51e8eabc049e Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 7 May 2018 15:47:29 -0400 Subject: [PATCH 41/50] consistancy --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 932bbac..313e95b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Cog Function | Name | Status | Description (Click to see full status) | --- | --- | --- | -| ccrole | **Beta** |
Create custom commands that also assign roles`May have some bugs, please create an issue if you find any`
| +| ccrole | **Beta** |
Create custom commands that also assign rolesMay have some bugs, please create an issue if you find any
| | chatter | **Alpha** |
Chat-bot trained to talk like your guildMissing some key features, but currently functional
| | fight | **Incomplete** |
Organize bracket tournaments within discordStill in-progress, a massive project
| | flag | **Incomplete** |
Create temporary marks on users that expire after specified timeNot yet ported to v3
| From b6a6854d0e967351a157188b07470e645e9b9436 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 7 May 2018 16:42:16 -0400 Subject: [PATCH 42/50] discord thing is cool? --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 313e95b..50d4eac 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,7 @@ Cog Function | werewolf | **Incomplete** |
Play the classic party game Werewolf within discordAnother massive project, will be fully customizable
| -Check out my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) \ No newline at end of file +Check out my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) + +Get support on the [Third Party Cog Server](https://discord.gg/GET4DVk) + \ No newline at end of file From 942238f5fb82981ed8fbede3a69aa281291908a5 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 7 May 2018 16:44:55 -0400 Subject: [PATCH 43/50] how about this? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50d4eac..7b3f40f 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,4 @@ Cog Function Check out my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) Get support on the [Third Party Cog Server](https://discord.gg/GET4DVk) - \ No newline at end of file + \ No newline at end of file From d1969311245a4cf8e9204476eea33df28c1cf447 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 7 May 2018 16:46:16 -0400 Subject: [PATCH 44/50] iframe disallowed --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 7b3f40f..1a807de 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,3 @@ Cog Function Check out my V2 cogs at [Fox-Cogs v2](https://github.com/bobloy/Fox-Cogs) Get support on the [Third Party Cog Server](https://discord.gg/GET4DVk) - \ No newline at end of file From 054a8422a08a8415d551b2a5f9e00dfe9be893b2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 10:34:34 -0400 Subject: [PATCH 45/50] Text eval And pep8 nonsense --- ccrole/ccrole.py | 206 ++++++++++++++++++++++++----------------------- 1 file changed, 106 insertions(+), 100 deletions(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index 38cff39..f3f8eb7 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -1,13 +1,10 @@ -import discord -import asyncio +import asyncio +import re +import discord from discord.ext import commands - from redbot.core import Config, checks - from redbot.core.utils.chat_formatting import pagify, box -import os -import re class CCRole: @@ -20,12 +17,11 @@ class CCRole: self.bot = bot self.config = Config.get_conf(self, identifier=9999114111108101) default_guild = { - "cmdlist" : {}, + "cmdlist": {}, "settings": {} } - - self.config.register_guild(**default_guild) + self.config.register_guild(**default_guild) @commands.group(no_pm=True) async def ccrole(self, ctx): @@ -35,7 +31,7 @@ class CCRole: @ccrole.command(name="add") @checks.mod_or_permissions(administrator=True) - async def ccrole_add(self, ctx, command : str): + async def ccrole_add(self, ctx, command: str): """Adds a custom command with roles""" command = command.lower() if command in self.bot.all_commands: @@ -45,125 +41,136 @@ class CCRole: guild = ctx.guild author = ctx.author channel = ctx.channel - - cmdlist = self.config.guild(ctx.guild).cmdlist - + + cmdlist = self.config.guild(guild).cmdlist + if await cmdlist.get_raw(command, default=None): await ctx.send("This command already exists. Delete it with `{}ccrole delete` first.".format(ctx.prefix)) return # Roles to add await ctx.send('What roles should it add? (Must be **comma separated**)\nSay `None` to skip adding roles') - + def check(m): - return m.author == author and m.channel==channel - + return m.author == author and m.channel == channel + try: answer = await self.bot.wait_for('message', timeout=120, check=check) except asyncio.TimeoutError: await ctx.send("Timed out, canceling") - + return + arole_list = [] - if answer.content.upper()!="NONE": + if answer.content.upper() != "NONE": arole_list = await self._get_roles_from_content(ctx, answer.content) if arole_list is None: await ctx.send("Invalid answer, canceling") return - + # Roles to remove await ctx.send('What roles should it remove? (Must be comma separated)\nSay `None` to skip removing roles') try: answer = await self.bot.wait_for('message', timeout=120, check=check) except asyncio.TimeoutError: await ctx.send("Timed out, canceling") - + return + rrole_list = [] - if answer.content.upper()!="NONE": + if answer.content.upper() != "NONE": rrole_list = await self._get_roles_from_content(ctx, answer.content) if rrole_list is None: await ctx.send("Invalid answer, canceling") return - + # Roles to use - await ctx.send('What roles are allowed to use this command? (Must be comma separated)\nSay `None` to allow all roles') - + await ctx.send( + 'What roles are allowed to use this command? (Must be comma separated)\nSay `None` to allow all roles') + try: answer = await self.bot.wait_for('message', timeout=120, check=check) except asyncio.TimeoutError: await ctx.send("Timed out, canceling") - + return + prole_list = [] - if answer.content.upper()!="NONE": + if answer.content.upper() != "NONE": prole_list = await self._get_roles_from_content(ctx, answer.content) if prole_list is None: await ctx.send("Invalid answer, canceling") return - + # Selfrole await ctx.send('Is this a targeted command?(yes/no)\nNo will make this a selfrole command') - + try: answer = await self.bot.wait_for('message', timeout=120, check=check) except asyncio.TimeoutError: await ctx.send("Timed out, canceling") - + return + if answer.content.upper() in ["Y", "YES"]: targeted = True await ctx.send("This command will be **`targeted`**") else: targeted = False await ctx.send("This command will be **`selfrole`**") - + # Message to send - await ctx.send('What message should the bot say when using this command?\nSay `None` to send the default `Success!` message') - + await ctx.send( + 'What message should the bot say when using this command?\n' + 'Say `None` to send the default `Success!` message') + try: answer = await self.bot.wait_for('message', timeout=120, check=check) except asyncio.TimeoutError: await ctx.send("Timed out, canceling") + return + text = "Success!" - if answer.content.upper()!="NONE": + if answer.content.upper() != "NONE": text = answer.content # Save the command - + out = {'text': text, 'aroles': arole_list, 'rroles': rrole_list, "proles": prole_list, "targeted": targeted} - + await cmdlist.set_raw(command, value=out) - + ctx.send("Custom Command **`{}`** successfully added".format(command)) - + @ccrole.command(name="delete") @checks.mod_or_permissions(administrator=True) - async def ccrole_delete(self, ctx, command : str): + async def ccrole_delete(self, ctx, command: str): """Deletes a custom command Example: [p]ccrole delete yourcommand""" guild = ctx.guild command = command.lower() - if not await self.config.guild(ctx.guild).cmdlist.get_raw(command, default=None): + if not await self.config.guild(guild).cmdlist.get_raw(command, default=None): await ctx.send("That command doesn't exist") else: - await self.config.guild(ctx.guild).cmdlist.set_raw(command, value=None) + await self.config.guild(guild).cmdlist.set_raw(command, value=None) await ctx.send("Custom command successfully deleted.") @ccrole.command(name="list") async def ccrole_list(self, ctx): """Shows custom commands list""" guild = ctx.guild - commands = await self.config.guild(ctx.guild).cmdlist() + cmd_list = await self.config.guild(guild).cmdlist() - if not commands: - await ctx.send("There are no custom commands in this server. Use `{}ccrole add` to start adding some.".format(ctx.prefix)) + if not cmd_list: + await ctx.send( + "There are no custom commands in this server. Use `{}ccrole add` to start adding some.".format( + ctx.prefix)) return - commands = ", ".join([ctx.prefix + c for c in sorted(commands.keys())]) - commands = "Custom commands:\n\n" + commands + cmd_list = ", ".join([ctx.prefix + c for c in sorted(cmd_list.keys())]) + cmd_list = "Custom commands:\n\n" + cmd_list - if len(commands) < 1500: - await ctx.send(box(commands)) + if len(cmd_list) < 1500: + await ctx.send(box(cmd_list)) else: - for page in pagify(commands, delims=[" ", "\n"]): + for page in pagify(cmd_list, delims=[" ", "\n"]): await ctx.author.send(box(page)) await ctx.send("Command list DM'd") @@ -177,24 +184,22 @@ class CCRole: except ValueError: return - cmdlist = self.config.guild(guild).cmdlist - cmd = message.content[len(prefix):].split()[0] - cmd = await cmdlist.get_raw(cmd.lower(), default=None) - - if cmd: + cmd = message.content[len(prefix):].split()[0].lower() + cmd = await cmdlist.get_raw(cmd, default=None) + + if cmd is not None: await self.eval_cc(cmd, message) - + async def _get_roles_from_content(self, ctx, content): content_list = content.split(",") - role_list = [] try: role_list = [discord.utils.get(ctx.guild.roles, name=role.strip(' ')).id for role in content_list] - except: + except (discord.HTTPException, AttributeError): # None.id is attribute error return None else: return role_list - + async def get_prefix(self, message: discord.Message) -> str: """ Borrowed from alias cog @@ -214,27 +219,26 @@ class CCRole: if content.startswith(p): return p raise ValueError - + async def eval_cc(self, cmd, message): """Does all the work""" if cmd['proles'] and not (set(role.id for role in message.author.roles) & set(cmd['proles'])): return # Not authorized, do nothing - + if cmd['targeted']: try: target = discord.utils.get(message.guild.members, mention=message.content.split()[1]) - except: + except IndexError: # .split() return list of len<2 target = None - + if not target: - out_message = "This command is targeted! @mention a target\n`{} `".format(message.content.split()[0]) - + out_message = "This custom command is targeted! @mention a target\n`{} `".format( + message.content.split()[0]) await message.channel.send(out_message) - return else: target = message.author - + if cmd['aroles']: arole_list = [discord.utils.get(message.guild.roles, id=roleid) for roleid in cmd['aroles']] # await self.bot.send_message(message.channel, "Adding: "+str([str(arole) for arole in arole_list])) @@ -243,7 +247,7 @@ class CCRole: except discord.Forbidden: await message.channel.send("Permission error: Unable to add roles") await asyncio.sleep(1) - + if cmd['rroles']: rrole_list = [discord.utils.get(message.guild.roles, id=roleid) for roleid in cmd['rroles']] # await self.bot.send_message(message.channel, "Removing: "+str([str(rrole) for rrole in rrole_list])) @@ -251,37 +255,39 @@ class CCRole: await target.remove_roles(*rrole_list) except discord.Forbidden: await message.channel.send("Permission error: Unable to remove roles") - await message.channel.send(cmd['text']) - - # {'text': text, 'aroles': arole_list, 'rroles': rrole_list, "proles", prole_list, "targeted": targeted} - - # def format_cc(self, command, message): - # results = re.findall("\{([^}]+)\}", command) - # for result in results: - # param = self.transform_parameter(result, message) - # command = command.replace("{" + result + "}", param) - # return command - - # def transform_parameter(self, result, message): - # """ - # For security reasons only specific objects are allowed - # Internals are ignored - # """ - # raw_result = "{" + result + "}" - # objects = { - # "message" : message, - # "author" : message.author, - # "channel" : message.channel, - # "server" : message.server - # } - # if result in objects: - # return str(objects[result]) - # try: - # first, second = result.split(".") - # except ValueError: - # return raw_result - # if first in objects and not second.startswith("_"): - # first = objects[first] - # else: - # return raw_result - # return str(getattr(first, second, raw_result)) \ No newline at end of file + + out_message = self.format_cc(cmd, message, target) + await message.channel.send(out_message) + + def format_cc(self, cmd, message, target): + out = cmd['text'] + results = re.findall("{([^}]+)\}", out) + for result in results: + param = self.transform_parameter(result, message, target) + out = out.replace("{" + result + "}", param) + return out + + def transform_parameter(self, result, message, target): + """ + For security reasons only specific objects are allowed + Internals are ignored + """ + raw_result = "{" + result + "}" + objects = { + "message": message, + "author": message.author, + "channel": message.channel, + "server": message.server, + "target": target + } + if result in objects: + return str(objects[result]) + try: + first, second = result.split(".") + except ValueError: + return raw_result + if first in objects and not second.startswith("_"): + first = objects[first] + else: + return raw_result + return str(getattr(first, second, raw_result)) From 5bff294b5957ae400475131e0620d9f3b468cea3 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 10:38:27 -0400 Subject: [PATCH 46/50] Forgot an await --- ccrole/ccrole.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index f3f8eb7..6a3fda5 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -136,7 +136,7 @@ class CCRole: await cmdlist.set_raw(command, value=out) - ctx.send("Custom Command **`{}`** successfully added".format(command)) + await ctx.send("Custom Command **`{}`** successfully added".format(command)) @ccrole.command(name="delete") @checks.mod_or_permissions(administrator=True) From 58979fc3aa2773d5ddfd34ead93ba68557f4f939 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 10:39:45 -0400 Subject: [PATCH 47/50] Almost forgot this is V3 --- ccrole/ccrole.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index 6a3fda5..721825b 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -277,7 +277,8 @@ class CCRole: "message": message, "author": message.author, "channel": message.channel, - "server": message.server, + "server": message.guild, + "guild": message.guild, "target": target } if result in objects: From cc89d07480eb15efca312d403a40ba95837febce Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 10:46:22 -0400 Subject: [PATCH 48/50] More details --- ccrole/ccrole.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index 721825b..4d3222c 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -25,14 +25,19 @@ class CCRole: @commands.group(no_pm=True) async def ccrole(self, ctx): - """Custom commands management""" + """Custom commands management with roles + + Highly customizable custom commands with role management.""" if not ctx.invoked_subcommand: await ctx.send_help() @ccrole.command(name="add") @checks.mod_or_permissions(administrator=True) async def ccrole_add(self, ctx, command: str): - """Adds a custom command with roles""" + """Adds a custom command with roles + + When adding text, put arguments in `{}` to eval them + Options: `{author}`, `{target}`, `{server}`, `{channel}`, `{message}`""" command = command.lower() if command in self.bot.all_commands: await ctx.send("That command is already a standard command.") @@ -118,7 +123,9 @@ class CCRole: # Message to send await ctx.send( 'What message should the bot say when using this command?\n' - 'Say `None` to send the default `Success!` message') + 'Say `None` to send the default `Success!` message\n' + 'Eval Options: `{author}`, `{target}`, `{server}`, `{channel}`, `{message}`\n' + 'For example: `Welcome {target.mention} to {server.name}!`') try: answer = await self.bot.wait_for('message', timeout=120, check=check) From 44784a34bc711aa07ad342ec6aec296784207ecf Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 11:36:29 -0400 Subject: [PATCH 49/50] ccrole details --- ccrole/ccrole.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index 4d3222c..59ead55 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -149,8 +149,9 @@ class CCRole: @checks.mod_or_permissions(administrator=True) async def ccrole_delete(self, ctx, command: str): """Deletes a custom command + Example: - [p]ccrole delete yourcommand""" + `[p]ccrole delete yourcommand`""" guild = ctx.guild command = command.lower() if not await self.config.guild(guild).cmdlist.get_raw(command, default=None): @@ -159,6 +160,32 @@ class CCRole: await self.config.guild(guild).cmdlist.set_raw(command, value=None) await ctx.send("Custom command successfully deleted.") + @ccrole.command(name="details") + async def ccrole_details(self, ctx, command: str): + """Provide details about passed custom command""" + guild = ctx.guild + command = command.lower() + cmd = await self.config.guild(guild).cmdlist.get_raw(command, default=None) + if cmd is None: + await ctx.send("That command doesn't exist") + return + + embed = discord.Embed(title=command, + description="{} custom command".format("Targeted" if cmd['targeted'] else "Non-Targeted")) + + def process_roles(role_list): + if not role_list: + return "None" + return ", ".join([discord.utils.get(ctx.guild.roles, id=roleid).name for roleid in role_list]) + + embed.add_field(name="Text", value="```{}```".format(cmd['text'])) + embed.add_field(name="Adds Roles", value=process_roles(cmd['aroles']), inline=True) + embed.add_field(name="Removes Roles", value=process_roles(cmd['rroles']), inline=True) + embed.add_field(name="Role Restrictions", value=process_roles(cmd['proles']), inline=True) + + await ctx.send(embed=embed) + + @ccrole.command(name="list") async def ccrole_list(self, ctx): """Shows custom commands list""" @@ -174,7 +201,7 @@ class CCRole: cmd_list = ", ".join([ctx.prefix + c for c in sorted(cmd_list.keys())]) cmd_list = "Custom commands:\n\n" + cmd_list - if len(cmd_list) < 1500: + if len(cmd_list) < 1500: # I'm allowed to have arbitrary numbers for when it's too much to dm dammit await ctx.send(box(cmd_list)) else: for page in pagify(cmd_list, delims=[" ", "\n"]): From 75e8ee13b22e6000596c7da33795c8814e605b2a Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 8 May 2018 11:54:07 -0400 Subject: [PATCH 50/50] Better defaults --- ccrole/ccrole.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index 59ead55..2459b6e 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -47,9 +47,9 @@ class CCRole: author = ctx.author channel = ctx.channel - cmdlist = self.config.guild(guild).cmdlist + cmd_list = self.config.guild(guild).cmdlist - if await cmdlist.get_raw(command, default=None): + if await cmd_list.get_raw(command, default=None): await ctx.send("This command already exists. Delete it with `{}ccrole delete` first.".format(ctx.prefix)) return @@ -141,7 +141,7 @@ class CCRole: out = {'text': text, 'aroles': arole_list, 'rroles': rrole_list, "proles": prole_list, "targeted": targeted} - await cmdlist.set_raw(command, value=out) + await cmd_list.set_raw(command, value=out) await ctx.send("Custom Command **`{}`** successfully added".format(command)) @@ -185,13 +185,12 @@ class CCRole: await ctx.send(embed=embed) - @ccrole.command(name="list") async def ccrole_list(self, ctx): """Shows custom commands list""" guild = ctx.guild cmd_list = await self.config.guild(guild).cmdlist() - + cmd_list = {k: v for k,v in cmd_list.items() if v} if not cmd_list: await ctx.send( "There are no custom commands in this server. Use `{}ccrole add` to start adding some.".format(