From 9016a1cec440aae93098653dd9f016c0836147ee Mon Sep 17 00:00:00 2001 From: xfnw Date: Wed, 15 Jul 2020 23:25:05 +0000 Subject: [PATCH] improve invite logging --- bot.py | 2 +- modules/invite.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 9b70a2d..8f64f99 100755 --- a/bot.py +++ b/bot.py @@ -35,7 +35,7 @@ class Oven(pydle.Client): self.modules[i] = m 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)) # self.t = time.time()+1 # await self.join(channel) diff --git a/modules/invite.py b/modules/invite.py index 6163653..3c8c068 100644 --- a/modules/invite.py +++ b/modules/invite.py @@ -1,3 +1,5 @@ +import time + async def invite(self, channel, by): if self.db['invite'].find_one(enabled='true'): 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)) self.t = time.time()+1 await self.join(channel) - + else: + print('ive been invited but invites are disabled') async def init(self):