Catch server version string, from RPL_MYINFO

This commit is contained in:
jesopo 2019-05-15 17:12:21 +01:00
parent 94d2f103b0
commit 7547eee96d
3 changed files with 9 additions and 0 deletions

View file

@ -67,6 +67,11 @@ class Module(ModuleManager.BaseModule):
def handle_005(self, event):
core.handle_005(self.events, event)
# RPL_MYINFO
@utils.hook("raw.received.004")
def handle_004(self, event):
core.handle_004(event)
# whois respose (nickname, username, realname, hostname)
@utils.hook("raw.received.311", default_event=True)
def handle_311(self, event):

View file

@ -55,6 +55,9 @@ def handle_005(events, event):
events.on("received.005").call(isupport=isupport,
server=event["server"])
def handle_004(event):
event["server"].version = event["args"][2]
def motd_start(event):
event["server"].motd_lines.clear()
def motd_line(event):

View file

@ -18,6 +18,7 @@ class Server(IRCObject.Object):
self.alias = alias
self.connection_params = connection_params
self.name = None # type: typing.Optional[str]
self.version = None # type: typing.Optional[str]
self.nickname = None # type: typing.Optional[str]
self.username = None # type: typing.Optional[str]