mirror of https://xfnw.ttm.sh/git/oirc.git
Compare commits
3 Commits
ab76b268b8
...
b2661792f2
Author | SHA1 | Date |
---|---|---|
vulpine | b2661792f2 | |
vulpine | 66cc1a6bcd | |
vulpine | cdf122ccce |
|
@ -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('')
|
||||
|
||||
|
||||
|
||||
|
|
@ -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('')
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue