diff options
| author | 2018-08-29 12:20:25 +0100 | |
|---|---|---|
| committer | 2018-08-29 12:20:25 +0100 | |
| commit | fead75cd2fa2996bee3500b2cbee3e484b680bca (patch) | |
| tree | 7bf36359a03dc5bf343c08142cda84bae86cf8fe /IRCServer.py | |
| parent | Change throttling mechanics to be "x lines per y seconds" (diff) | |
| signature | ||
Refactor IRCLineHandler in to an object that uses .on("raw") events
Diffstat (limited to 'IRCServer.py')
| -rw-r--r-- | IRCServer.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/IRCServer.py b/IRCServer.py index 4a2e3b5a..46dedbb7 100644 --- a/IRCServer.py +++ b/IRCServer.py @@ -1,5 +1,5 @@ import collections, socket, ssl, sys, time -import IRCChannel, IRCLineHandler, IRCUser +import IRCChannel, IRCUser OUR_TLS_PROTOCOL = ssl.PROTOCOL_SSLv23 THROTTLE_LINES = 4 @@ -168,22 +168,7 @@ class Server(object): def parse_line(self, line): if not line: return - original_line = line - prefix, final = None, None - if line[0] == ":": - prefix, line = line[1:].split(" ", 1) - - command, line = (line.split(" ", 1) + [""])[:2] - - if line[0] == ":": - final, line = line[1:], "" - elif " :" in line: - line, final = line.split(" :", 1) - - args_split = line.split(" ") if line else [] - if final: - args_split.append(final) - IRCLineHandler.handle(original_line, prefix, command, args_split, final!=None, self.bot, self) + self.bot.line_handler.handle(self, line) self.check_users() def check_users(self): for user in self.new_users: |
