fixes #1 (im dumb and overwrote a pydle func) (ok i finnally fixed this kiedtl lol)

This commit is contained in:
vulpine 2020-10-04 12:17:30 -04:00
parent 88167824bc
commit 84f3f608e6
9 changed files with 16 additions and 13 deletions

6
bot.py
View File

@ -9,7 +9,7 @@ class Balun(pydle.Client):
self.modules = {}
self.cmd = {}
self.raw = {}
self.rawm = {}
self.help = {}
self.db = dataset.connect('sqlite:///database.db')
self.t=0
@ -58,8 +58,8 @@ class Balun(pydle.Client):
if msg == '!botlist':
await self.message(chan, 'helo im owen\'s nice bot https://xfnw.ttm.sh/git/oirc')
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:

View File

@ -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:

View File

@ -2,14 +2,17 @@ import random
async def coffeeup(self,c,n,m):
if c in ['#coffee','#tea','#water']:
if c in ['#coffee','#tea','#water','#CAPS']:
if (c[1:]+"!" in m and c+'!' not in m) or c=='#coffee' and ('latte!' in m or 'espresso!' in m):
cc = self.coffee.find_one(name=c)
if cc:
self.coffee.update(dict(name=c,value=cc['value']+1),['name'])
else:
self.coffee.insert(dict(name=c,value=1))
await self.message(c, '[\x036drinks\x0f] ・゜゜・。。・゜゜c[~] {} UP!'.format(c[1:].upper()))
if c=='#CAPS':
await self.message(c, '[\x036drinks\x0f] ・゜゜・。。・゜゜c[~] {} UP!'.format(c[1:].upper()).upper())
else:
await self.message(c, '[\x036drinks\x0f] ・゜゜・。。・゜゜c[~] {} UP!'.format(c[1:].upper()))
elif "cupcount" in m:
await self.message(c, '[\x036drinks\x0f] {} delicious cups of {}{} served so far!'.format(
self.coffee.find_one(name=c)['value'], random.choice(self.coffeetypes), c[1:]
@ -19,7 +22,7 @@ async def coffeeup(self,c,n,m):
async def init(self):
self.raw['coffeeup'] = coffeeup
self.rawm['coffeeup'] = coffeeup
self.coffee = self.db['coffee']
self.coffeetypes = [

View File

@ -11,6 +11,6 @@ async def source(self,c,n,m):
async def init(self):
self.help['modules'] = ['modules - list the modules',':o']
self.cmd['modules'] = listMods
self.raw['source'] = source
self.rawm['source'] = source

View File

@ -32,7 +32,7 @@ async def owotext(self, back, chan):
async def init(self):
self.owolog = {}
self.raw['owolog'] = owologger
self.rawm['owolog'] = owologger
self.cmd['owo'] = owoify
self.help['owo'] = ['owo [num] - owoify the text', 'owo owo uwu']

View File

@ -11,6 +11,6 @@ async def pd(self,c,n,m):
await self.notice(self.ducknotif,'i predict there will be a duck in {} soon'.format(c))
async def init(self):
self.raw['pd'] = pd
self.rawm['pd'] = pd
self.ducknotif='xfnw'
self.duckmsg = {}

View File

@ -32,5 +32,5 @@ async def init(self):
self.plog = {}
self.wlevel = {}
self.mutesyntax = ['+b','m:{}'] # ['+q','{}'] on freenode
self.raw['preventionlog'] = plogger
self.rawm['preventionlog'] = plogger

View File

@ -63,7 +63,7 @@ async def init(self):
self.help['rpn'] = ['rpn <inp> - simple reverse polish notation calculator (more)', 'it has an alias of . so you can just do {}. <inp>, and if enabled it will also parse floats and functions as input. there are 4 functions, add (+|a), subtract (-|s), multiply (*|x|m), and devide (/|d), and p to print register 0'.format(self.prefix)]
self.cmd['rpn'] = rpninp
self.cmd['.'] = rpninp
self.raw['rpn'] = rpninp
self.rawm['rpn'] = rpninp
self.cmd['rt'] = rpntoggle
self.help['rt'] = ['rt - toggle the output of rpn calculatons into the channel', 'rpn is cool']

View File

@ -23,7 +23,7 @@ async def getPronouns(self,c,n,m):
await self.message(c,'[\x036scrape\x0f] sorry i could not find {}\'s pronouns. (i scrape pronouns from logs, you dont need to set them :3 )'.format(m))
async def init(self):
self.raw['scraper'] = scraper
self.rawm['scraper'] = scraper
self.pronoundb = self.db['pronouns']
self.cmd['pronouns'] = getPronouns