admin join/part

This commit is contained in:
lickthecheese 2020-04-05 20:21:10 -04:00
parent 7a29ad5c85
commit 0f2ae58bbb
5 changed files with 18 additions and 6 deletions

7
bot.py
View file

@ -14,6 +14,9 @@ class Oven(pydle.Client):
print('loading modules...') print('loading modules...')
await self.loadMods() await self.loadMods()
print('joining channels')
for i in self.chansjoin:
await self.join(i)
print('Done!') print('Done!')
async def loadMods(self): async def loadMods(self):
@ -25,7 +28,9 @@ class Oven(pydle.Client):
await m.init(self) await m.init(self)
self.modules[i] = m self.modules[i] = m
async def on_invite(self, channel, by):
print('{} invited me to {}!'.format(by, channel))
await self.join(channel)
async def on_message(self, chan, source, msg): async def on_message(self, chan, source, msg):

Binary file not shown.

View file

@ -20,12 +20,20 @@ async def reloadmods(self, chan, source, msg):
await self.modules[i].init(self) await self.modules[i].init(self)
await self.message(chan, 'done! did something break? if so you might need to restart') await self.message(chan, 'done! did something break? if so you might need to restart')
async def part(self, chan, source, msg):
await self.message(chan, 'bye {}'.format(msg))
await self.part(msg)
async def join(self, chan, source, msg):
await self.message(chan, 'joined {}'.format(msg))
await self.join(msg)
commands = { commands = {
'quit': quit, 'quit': quit,
'reload': reloadmods, 'reload': reloadmods,
'commit': commit 'commit': commit,
'part': part,
'join': join
} }
async def adminHandle(self, chan, source, msg): async def adminHandle(self, chan, source, msg):

View file

@ -1,11 +1,10 @@
async def init(self): async def init(self):
self.chansjoin = ['#bots'] self.chansjoin = ['#bots']
print('joining channels', ' '.join(self.chansjoin))
for i in self.chansjoin:
await self.join(i)