Compare commits

...

2 Commits

Author SHA1 Message Date
vulpine 6e5e726e05 case-insensitive drinks
this is achived by String.lower()'ing both the message and the channel
name.

you can now drink COFFEE! if you are EXITED!
2020-12-11 10:19:38 -05:00
vulpine 59a76e1440 fix deletion of keeps 2020-12-11 10:16:56 -05:00
2 changed files with 9 additions and 3 deletions

View File

@ -4,8 +4,14 @@ from bot import *
async def coffeeup(self,c,n,m):
if c in ['#coffee','#tea','#water','#CAPS','#sodawater']:
if (c[1:]+"!" in m and c+'!' not in m) or c=='#coffee' and ('latte!' in m or 'espresso!' in m or 'cappucino!' in m) or c=='#tea' and ('chai!' in m):
m = m.lower()
c = c.lower()
if c in ['#coffee','#tea','#water','#caps','#sodawater']:
if (
(c[1:]+"!" in m and c+'!' not in m)
or c=='#coffee' and ('latte!' in m or 'espresso!' in m or 'cappucino!' in m)
or c=='#tea' and ('chai!' in m or 'kombucha!' in m)
):
cc = self.coffee.find_one(name=c)
if cc:
self.coffee.update(dict(name=c,value=cc['value']+1),['name'])

View File

@ -51,7 +51,7 @@ async def addkeep(self,c,n,m):
await self.message(c,'[\x036keep\x0f] keep added!')
async def rmkeep(self,c,n,m):
if n in self.channels[self.rmkeepchan]['modes']['o']:
if n in self.channels[self.rmkeepchan].users and 'o' in self.channels[self.rmkeepchan].users[n].modes:
co = m.strip().split(' ')
if len(co) < 2:
await self.message(c,'[\x036keep\x0f] wrong syntax')