added /me
This commit is contained in:
parent
0c84a52bc7
commit
fcf70d344d
12
commands.py
12
commands.py
|
@ -15,6 +15,9 @@ class Command:
|
||||||
def notice(self, msg):
|
def notice(self, msg):
|
||||||
self.util.notice(msg)
|
self.util.notice(msg)
|
||||||
|
|
||||||
|
def action(self, msg):
|
||||||
|
self.util.action(msg)
|
||||||
|
|
||||||
def send(self, msg):
|
def send(self, msg):
|
||||||
self.util.send(msg)
|
self.util.send(msg)
|
||||||
|
|
||||||
|
@ -95,6 +98,8 @@ class Command:
|
||||||
command = "help"
|
command = "help"
|
||||||
elif cmd.startswith("echo "):
|
elif cmd.startswith("echo "):
|
||||||
command = "echo"
|
command = "echo"
|
||||||
|
elif cmd.startswith("me "):
|
||||||
|
command = "me"
|
||||||
elif cmd == "dbg" or cmd.startswith("dbg "):
|
elif cmd == "dbg" or cmd.startswith("dbg "):
|
||||||
command = "dbg"
|
command = "dbg"
|
||||||
elif cmd == "dbg2" or cmd.startswith("dbg2 "):
|
elif cmd == "dbg2" or cmd.startswith("dbg2 "):
|
||||||
|
@ -109,7 +114,7 @@ class Command:
|
||||||
):
|
):
|
||||||
command = "yt"
|
command = "yt"
|
||||||
else:
|
else:
|
||||||
self.mesg(cmd)
|
#self.mesg(cmd)
|
||||||
return
|
return
|
||||||
if command not in self.config.cmd.disabled:
|
if command not in self.config.cmd.disabled:
|
||||||
eval(f"self.{command}()")
|
eval(f"self.{command}()")
|
||||||
|
@ -157,6 +162,11 @@ class Command:
|
||||||
"""simple echo command"""
|
"""simple echo command"""
|
||||||
mesg(cmd.split(" ", 1)[1])
|
mesg(cmd.split(" ", 1)[1])
|
||||||
|
|
||||||
|
@cmd
|
||||||
|
def me(self, prefix, cmd, pm, line, admin, mesg):
|
||||||
|
"""simple /me command"""
|
||||||
|
self.action(cmd.split(" ", 1)[1])
|
||||||
|
|
||||||
@cmd
|
@cmd
|
||||||
def help(self, prefix, cmd, pm, line, admin, mesg):
|
def help(self, prefix, cmd, pm, line, admin, mesg):
|
||||||
global adm_cmds
|
global adm_cmds
|
||||||
|
|
3
util.py
3
util.py
|
@ -71,6 +71,9 @@ class Util:
|
||||||
def mesg(self, msg: str, t=None):
|
def mesg(self, msg: str, t=None):
|
||||||
t,msg=self._m(msg,t)
|
t,msg=self._m(msg,t)
|
||||||
self.send(irctokens.build("PRIVMSG", [t, str(msg)]).format())
|
self.send(irctokens.build("PRIVMSG", [t, str(msg)]).format())
|
||||||
|
def action(self, msg: str, t=None):
|
||||||
|
t,msg=self._m(msg,t)
|
||||||
|
self.send(irctokens.build("PRIVMSG", [t, "\x01ACTION "+str(msg)+"\x01"]).format())
|
||||||
def notice(self, msg: str, t=None):
|
def notice(self, msg: str, t=None):
|
||||||
t,msg=self._m(msg,t)
|
t,msg=self._m(msg,t)
|
||||||
self.send(irctokens.build("NOTICE", [t, str(msg)]).format())
|
self.send(irctokens.build("NOTICE", [t, str(msg)]).format())
|
||||||
|
|
Loading…
Reference in New Issue