admin join/part
This commit is contained in:
parent
7a29ad5c85
commit
0f2ae58bbb
5 changed files with 18 additions and 6 deletions
7
bot.py
7
bot.py
|
@ -14,6 +14,9 @@ class Oven(pydle.Client):
|
|||
|
||||
print('loading modules...')
|
||||
await self.loadMods()
|
||||
print('joining channels')
|
||||
for i in self.chansjoin:
|
||||
await self.join(i)
|
||||
print('Done!')
|
||||
|
||||
async def loadMods(self):
|
||||
|
@ -25,7 +28,9 @@ class Oven(pydle.Client):
|
|||
await m.init(self)
|
||||
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):
|
||||
|
|
Binary file not shown.
BIN
modules/__pycache__/channels.cpython-36.pyc
Normal file
BIN
modules/__pycache__/channels.cpython-36.pyc
Normal file
Binary file not shown.
|
@ -20,12 +20,20 @@ async def reloadmods(self, chan, source, msg):
|
|||
await self.modules[i].init(self)
|
||||
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 = {
|
||||
'quit': quit,
|
||||
'reload': reloadmods,
|
||||
'commit': commit
|
||||
'commit': commit,
|
||||
'part': part,
|
||||
'join': join
|
||||
}
|
||||
|
||||
async def adminHandle(self, chan, source, msg):
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
async def init(self):
|
||||
self.chansjoin = ['#bots']
|
||||
|
||||
print('joining channels', ' '.join(self.chansjoin))
|
||||
for i in self.chansjoin:
|
||||
await self.join(i)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue