improve invite logging

This commit is contained in:
xfnw 2020-07-15 23:25:05 +00:00
parent 39a87efb0b
commit 9016a1cec4
2 changed files with 5 additions and 2 deletions

2
bot.py
View file

@ -35,7 +35,7 @@ class Oven(pydle.Client):
self.modules[i] = m self.modules[i] = m
async def on_invite(self, channel, by): async def on_invite(self, channel, by):
modules['invite'].invite(self, channel, by) await self.modules['invite'].invite(self, channel, by)
# print('{} invited me to {}!'.format(by, channel)) # print('{} invited me to {}!'.format(by, channel))
# self.t = time.time()+1 # self.t = time.time()+1
# await self.join(channel) # await self.join(channel)

View file

@ -1,3 +1,5 @@
import time
async def invite(self, channel, by): async def invite(self, channel, by):
if self.db['invite'].find_one(enabled='true'): if self.db['invite'].find_one(enabled='true'):
if self.db['invite'].find_one(blacklist=channel): if self.db['invite'].find_one(blacklist=channel):
@ -6,7 +8,8 @@ async def invite(self, channel, by):
print('{} invited me to {}!'.format(by, channel)) print('{} invited me to {}!'.format(by, channel))
self.t = time.time()+1 self.t = time.time()+1
await self.join(channel) await self.join(channel)
else:
print('ive been invited but invites are disabled')
async def init(self): async def init(self):