fixed commands
This commit is contained in:
parent
2f9e2bd92d
commit
5784a0a1fd
3 changed files with 10 additions and 1 deletions
3
bot.py
3
bot.py
|
@ -38,8 +38,9 @@ class Oven(pydle.Client):
|
||||||
for i in self.raw:
|
for i in self.raw:
|
||||||
await self.raw[i](self, chan,source,msg)
|
await self.raw[i](self, chan,source,msg)
|
||||||
if msg[:len(self.prefix)] == self.prefix:
|
if msg[:len(self.prefix)] == self.prefix:
|
||||||
|
msg = msg[len(self.prefix):]
|
||||||
cmd = msg.split(' ')[0]
|
cmd = msg.split(' ')[0]
|
||||||
msg = msg[len(cmd):]
|
msg = msg[len(cmd)+1:]
|
||||||
if cmd in self.cmd:
|
if cmd in self.cmd:
|
||||||
await self.cmd[cmd](self, chan, source, msg)
|
await self.cmd[cmd](self, chan, source, msg)
|
||||||
async def is_admin(self, nickname):
|
async def is_admin(self, nickname):
|
||||||
|
|
BIN
modules/__pycache__/admin.cpython-36.pyc
Normal file
BIN
modules/__pycache__/admin.cpython-36.pyc
Normal file
Binary file not shown.
8
modules/admin.py
Normal file
8
modules/admin.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
async def adminHandle(self, chan, source, msg):
|
||||||
|
await self.message(chan, msg)
|
||||||
|
|
||||||
|
|
||||||
|
async def init(self):
|
||||||
|
self.cmd['admin'] = adminHandle
|
Loading…
Reference in a new issue