log admin command execution

This commit is contained in:
lickthecheese 2020-04-05 19:52:31 -04:00
parent 7beae06735
commit 2c56c7dde4
3 changed files with 9 additions and 2 deletions

2
bot.py
View file

@ -61,5 +61,5 @@ if __name__ == "__main__":
client.chansjoin = ['#bots'] client.chansjoin = ['#bots']
client.admins = ['lickthecheese'] client.admins = ['lickthecheese']
client.prefix = 'ov ' client.prefix = 'ov '
client.run('irc.tilde.chat', tls=True, tls_verify=False) client.run('team.tilde.chat', tls=True, tls_verify=False)

View file

@ -2,9 +2,14 @@
import importlib import importlib
async def commit(self, chan, source, msg):
await self.quit('{} told me to commit {}'.format(source,msg))
async def quit(self, chan, source, msg): async def quit(self, chan, source, msg):
await self.quit('{} told me to {}'.format(source,msg)) await self.quit('{} told me to {}'.format(source,msg))
async def reloadmods(self, chan, source, msg): async def reloadmods(self, chan, source, msg):
await self.message(chan, 'reloading modules...') await self.message(chan, 'reloading modules...')
self.cmd = {} self.cmd = {}
@ -19,7 +24,8 @@ async def reloadmods(self, chan, source, msg):
commands = { commands = {
'quit': quit, 'quit': quit,
'reload': reloadmods 'reload': reloadmods,
'commit': commit
} }
async def adminHandle(self, chan, source, msg): async def adminHandle(self, chan, source, msg):
@ -28,6 +34,7 @@ async def adminHandle(self, chan, source, msg):
if len(msg) < 1 or not msg[0] in commands: if len(msg) < 1 or not msg[0] in commands:
await self.message(chan, 'you press the wrong button on the oven and it burns you') await self.message(chan, 'you press the wrong button on the oven and it burns you')
return return
print('[ADMIN MODULE] {} told me to {}!!!'.format(source,msg[0]))
await commands[msg.pop(0)](self, chan, source, ' '.join(msg)) await commands[msg.pop(0)](self, chan, source, ' '.join(msg))
else: else:
await self.message(chan, 'you try to open it, but the oven is locked') await self.message(chan, 'you try to open it, but the oven is locked')