fixes #1 (im dumb and overwrote a pydle func)
This commit is contained in:
parent
cae7fcbfd3
commit
2a21032df2
3 changed files with 9 additions and 9 deletions
14
bot.py
14
bot.py
|
@ -3,13 +3,13 @@
|
|||
|
||||
import pydle, asyncio, dataset, sys, os, time
|
||||
|
||||
class Oven(pydle.Client):
|
||||
class Kim(pydle.Client):
|
||||
async def on_connect(self):
|
||||
print('Connected!')
|
||||
|
||||
self.modules = {}
|
||||
self.cmd = {}
|
||||
self.raw = {}
|
||||
self.rawm = {}
|
||||
self.help = {}
|
||||
self.db = dataset.connect('sqlite:///database.db')
|
||||
self.t=0
|
||||
|
@ -53,8 +53,8 @@ class Oven(pydle.Client):
|
|||
if msg == '!botlist':
|
||||
await self.message(chan, 'helo im kim, a learning chatbot https://tildegit.org/xfnw/kim/')
|
||||
await self.parseCommand(chan, source, msg)
|
||||
for i in self.raw:
|
||||
await self.raw[i](self, chan, source, msg)
|
||||
for i in self.rawm:
|
||||
await self.rawm[i](self, chan, source, msg)
|
||||
|
||||
async def parseCommand(self, chan, source, msg):
|
||||
if msg[:len(self.prefix)] == self.prefix:
|
||||
|
@ -90,12 +90,12 @@ class Oven(pydle.Client):
|
|||
|
||||
#async def on_private_message(self, trash, source, msg):
|
||||
# if source != self.nickname:
|
||||
# for i in self.raw:
|
||||
# await self.raw[i](self, source, source, msg)
|
||||
# for i in self.rawm:
|
||||
# await self.rawm[i](self, source, source, msg)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
client = Oven('kim', realname='owens bot')
|
||||
client = Kim('kim', realname='owens bot')
|
||||
client.admins = ['lickthecheese', 'ben', 'coffeeowl', 'gbmor', 'tomasino', 'ubergeek', 'deepend', 'calamitous', 'khuxkm']
|
||||
client.prefix = 'kim: '
|
||||
client.run('team.tilde.chat', tls=True, tls_verify=False)
|
||||
|
|
|
@ -13,7 +13,7 @@ async def reloadmods(self, chan, source, msg):
|
|||
await self.message(chan, '[\x036admin\x0f] reloading modules...')
|
||||
self.oldcmd = self.cmd
|
||||
self.cmd = {}
|
||||
self.raw = {}
|
||||
self.rawm = {}
|
||||
self.help = {}
|
||||
try:
|
||||
for i in self.modules:
|
||||
|
|
|
@ -97,6 +97,6 @@ async def init(self):
|
|||
self.learntime = 0
|
||||
self.learndelay = 4
|
||||
self.enmul = 25
|
||||
self.raw['nlp'] = filter
|
||||
self.rawm['nlp'] = filter
|
||||
|
||||
self.cstate = {}
|
||||
|
|
Loading…
Reference in a new issue