diff --git a/bot.py b/bot.py index 193f0ca..935026d 100755 --- a/bot.py +++ b/bot.py @@ -72,7 +72,7 @@ class Oven(pydle.Client): if __name__ == "__main__": client = Oven('kim', realname='Kim Jong Un?') - client.admins = ['lickthecheese', 'ben', 'cmccabe'] + client.admins = ['lickthecheese', 'ben', 'cmccabe', 'gbmor', 'tomasino', 'ubergeek', 'deepend', 'calamitous'] client.prefix = 'kim: ' client.run('team.tilde.chat', tls=True, tls_verify=False) diff --git a/modules/__pycache__/admin.cpython-36.pyc b/modules/__pycache__/admin.cpython-36.pyc index 085d23f..f1739c6 100644 Binary files a/modules/__pycache__/admin.cpython-36.pyc and b/modules/__pycache__/admin.cpython-36.pyc differ diff --git a/modules/__pycache__/nlp.cpython-36.pyc b/modules/__pycache__/nlp.cpython-36.pyc index 5a2cddb..8ddac0c 100644 Binary files a/modules/__pycache__/nlp.cpython-36.pyc and b/modules/__pycache__/nlp.cpython-36.pyc differ diff --git a/modules/admin.py b/modules/admin.py index 082e0c0..8369213 100644 --- a/modules/admin.py +++ b/modules/admin.py @@ -1,5 +1,5 @@ -import importlib +import importlib, time async def commit(self, chan, source, msg): @@ -44,6 +44,10 @@ async def send(self, c, n, m): await self.message(msg.pop(0), ' '.join(msg)) await self.message(c, 'ok') +async def shut(self, c, n, m): + self.qtime[c] = time.time()+(60*10) + await self.message(c, 'Ok, il be back') + commands = { 'quit': quit, 'reload': reloadmods, @@ -52,7 +56,8 @@ commands = { 'join': join, 'eval': ev, 'send': send, - 'joins': joins + 'joins': joins, + 'shut': shut } async def adminHandle(self, chan, source, msg): diff --git a/modules/nlp.py b/modules/nlp.py index 7d91312..94a5c30 100644 --- a/modules/nlp.py +++ b/modules/nlp.py @@ -1,6 +1,7 @@ import dataset import random +import time async def rec(self, m): prew = self.db['prew'] @@ -52,6 +53,8 @@ async def genOut(self, noun): async def filter(self, c, n, m): + if c in self.qtime and self.qtime[c] > time.time(): + return if m[:5] == 'kim: ': m = m[5:] await go(self, c, n, m) @@ -68,7 +71,8 @@ async def go(self, c, n, m): async def init(self): self.db = dataset.connect('sqlite:///database.db') - + + self.qtime = {} self.enmul = 1 self.raw['nlp'] = filter