diff options
| author | 2016-03-29 16:22:22 +0100 | |
|---|---|---|
| committer | 2016-03-29 16:22:22 +0100 | |
| commit | 57a0e2f10fa1a3dc879a9f9a2bc000e13c54826a (patch) | |
| tree | 5a9f17a831ea9fa75cd36ea894001440c01050a6 /IRCServer.py | |
| parent | made it possible to get http code even when a HTTPError kicks up. (diff) | |
made commands work in channel AND in private message.
Diffstat (limited to 'IRCServer.py')
| -rw-r--r-- | IRCServer.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/IRCServer.py b/IRCServer.py index 1f291c23..aad88f41 100644 --- a/IRCServer.py +++ b/IRCServer.py @@ -183,12 +183,14 @@ class Server(object): self.send("QUIT :%s" % reason) def send_message(self, target, message): self.send("PRIVMSG %s :%s" % (target, message)) + action = message.startswith("\01ACTION ") and message.endswith( + "\01") + if action: + message = message.split("\01ACTION ", 1)[1][:-1] if self.has_channel(target): - action = message.startswith("\01ACTION ") and message.endswith( - "\01") - if action: - message = message.split("\01ACTION ", 1)[1][:-1] self.get_channel(target).log.add_line(None, message, action, True) + else: + self.get_user(target).log.add_line(None, message, action, True) def send_notice(self, target, message): self.send("NOTICE %s :%s" % (target, message)) def send_mode(self, target, mode=None, args=None): |
