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
|
import pydle, asyncio, dataset, sys, os, time
|
||||||
|
|
||||||
class Oven(pydle.Client):
|
class Kim(pydle.Client):
|
||||||
async def on_connect(self):
|
async def on_connect(self):
|
||||||
print('Connected!')
|
print('Connected!')
|
||||||
|
|
||||||
self.modules = {}
|
self.modules = {}
|
||||||
self.cmd = {}
|
self.cmd = {}
|
||||||
self.raw = {}
|
self.rawm = {}
|
||||||
self.help = {}
|
self.help = {}
|
||||||
self.db = dataset.connect('sqlite:///database.db')
|
self.db = dataset.connect('sqlite:///database.db')
|
||||||
self.t=0
|
self.t=0
|
||||||
|
@ -53,8 +53,8 @@ class Oven(pydle.Client):
|
||||||
if msg == '!botlist':
|
if msg == '!botlist':
|
||||||
await self.message(chan, 'helo im kim, a learning chatbot https://tildegit.org/xfnw/kim/')
|
await self.message(chan, 'helo im kim, a learning chatbot https://tildegit.org/xfnw/kim/')
|
||||||
await self.parseCommand(chan, source, msg)
|
await self.parseCommand(chan, source, msg)
|
||||||
for i in self.raw:
|
for i in self.rawm:
|
||||||
await self.raw[i](self, chan, source, msg)
|
await self.rawm[i](self, chan, source, msg)
|
||||||
|
|
||||||
async def parseCommand(self, chan, source, msg):
|
async def parseCommand(self, chan, source, msg):
|
||||||
if msg[:len(self.prefix)] == self.prefix:
|
if msg[:len(self.prefix)] == self.prefix:
|
||||||
|
@ -90,12 +90,12 @@ class Oven(pydle.Client):
|
||||||
|
|
||||||
#async def on_private_message(self, trash, source, msg):
|
#async def on_private_message(self, trash, source, msg):
|
||||||
# if source != self.nickname:
|
# if source != self.nickname:
|
||||||
# for i in self.raw:
|
# for i in self.rawm:
|
||||||
# await self.raw[i](self, source, source, msg)
|
# await self.rawm[i](self, source, source, msg)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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.admins = ['lickthecheese', 'ben', 'coffeeowl', 'gbmor', 'tomasino', 'ubergeek', 'deepend', 'calamitous', 'khuxkm']
|
||||||
client.prefix = 'kim: '
|
client.prefix = 'kim: '
|
||||||
client.run('team.tilde.chat', tls=True, tls_verify=False)
|
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...')
|
await self.message(chan, '[\x036admin\x0f] reloading modules...')
|
||||||
self.oldcmd = self.cmd
|
self.oldcmd = self.cmd
|
||||||
self.cmd = {}
|
self.cmd = {}
|
||||||
self.raw = {}
|
self.rawm = {}
|
||||||
self.help = {}
|
self.help = {}
|
||||||
try:
|
try:
|
||||||
for i in self.modules:
|
for i in self.modules:
|
||||||
|
|
|
@ -97,6 +97,6 @@ async def init(self):
|
||||||
self.learntime = 0
|
self.learntime = 0
|
||||||
self.learndelay = 4
|
self.learndelay = 4
|
||||||
self.enmul = 25
|
self.enmul = 25
|
||||||
self.raw['nlp'] = filter
|
self.rawm['nlp'] = filter
|
||||||
|
|
||||||
self.cstate = {}
|
self.cstate = {}
|
||||||
|
|
Loading…
Reference in a new issue