Compare commits

...

3 Commits

Author SHA1 Message Date
vulpine b2661792f2 dont drink up the bots! 2020-09-13 21:22:15 -04:00
vulpine 66cc1a6bcd allow arbitrary drinks channels 2020-09-13 21:11:47 -04:00
vulpine cdf122ccce rename coffee module to drinks 2020-09-13 20:56:31 -04:00
2 changed files with 37 additions and 51 deletions

View File

@ -1,51 +0,0 @@
import random
async def coffeeup(self,c,n,m):
if c == '#coffee':
if "coffee!" in m:
cc = self.coffee.find_one(name='cupcount')
if cc:
self.coffee.update(dict(name='cupcount',value=cc['value']+1),['name'])
else:
self.coffee.insert(dict(name='cupcount',value=1))
await self.message(c, '[\x036coffee\x0f] ・゜゜・。。・゜゜c[~] COFFEE UP!')
elif "cupcount" in m:
await self.message(c, '[\x036coffee\x0f] {} delicious cups of {}coffee served so far!'.format(
self.coffee.find_one(name='cupcount')['value'], random.choice(self.coffeetypes)
))
if c == '#tea':
if "tea!" in m:
cc = self.coffee.find_one(name='teacount')
if cc:
self.coffee.update(dict(name='teacount',value=cc['value']+1),['name'])
else:
self.coffee.insert(dict(name='teacount',value=1))
await self.message(c, '[\x036coffee\x0f] ・゜゜・。。・゜゜[_]b TEA UP!')
elif "cupcount" in m:
await self.message(c, '[\x036coffee\x0f] {} delicious mugs of {}tea served so far!'.format(
self.coffee.find_one(name='teacount')['value'], random.choice(self.coffeetypes)
))
async def init(self):
self.raw['coffeeup'] = coffeeup
self.coffee = self.db['coffee']
self.coffeetypes = [
"kum\u200cquat's aeropressed ",
"hot ",
"OSHA-compliant ",
"cmc\u200ccabe's nom nom nom yummy ",
"healthy ",
]
for i in range(len(self.coffeetypes)):
self.coffeetypes.append('')

37
modules/drinks.py Normal file
View File

@ -0,0 +1,37 @@
import random
async def coffeeup(self,c,n,m):
if c in ['#coffee','#tea','#water']:
if c[1:]+"!" in m and c+'!' not 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()))
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:]
))
async def init(self):
self.raw['coffeeup'] = coffeeup
self.coffee = self.db['coffee']
self.coffeetypes = [
"kum\u200cquat's aeropressed ",
"hot ",
"OSHA-compliant ",
"cmc\u200ccabe's nom nom nom yummy ",
"healthy ",
]
for i in range(len(self.coffeetypes)):
self.coffeetypes.append('')