improve invites

This commit is contained in:
xfnw 2020-07-15 23:24:09 +00:00
parent c257dd13cc
commit 39a87efb0b
4 changed files with 75 additions and 3 deletions

9
bot.py
View file

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

14
modules/invite.py Normal file
View file

@ -0,0 +1,14 @@
async def invite(self, channel, by):
if self.db['invite'].find_one(enabled='true'):
if self.db['invite'].find_one(blacklist=channel):
print('{} invited me to {}, a blacklisted channel'.format(by,channel))
return
print('{} invited me to {}!'.format(by, channel))
self.t = time.time()+1
await self.join(channel)
async def init(self):
pass

55
sizelog Normal file
View file

@ -0,0 +1,55 @@
2172
2172
2332
2528
2732
2956
3192
3416
3640
3848
4080
4132
4172
4200
4208
4240
4248
4252
4256
4260
4264
4276
4296
4324
4384
4420
4460
4496
4528
4544
4544
4556
4604
4696
4732
4744
4776
4776
4776
4776
4784
4792
4800
4816
4824
4844
4880
4896
4928
4972
4996
5072
5108
5144
5204