allow ops to tell the bot to shut up lol
This commit is contained in:
parent
fbdd70602c
commit
4ad625de5b
5 changed files with 13 additions and 4 deletions
2
bot.py
2
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)
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue