irc: Add VERSION command
patch 88dc8263a1e44bbacb642ba34ec7ddcfa6ec0719
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sun Feb 21 23:35:32 CET 2021
* irc: Add VERSION command
hunk ./irc.py 37
+IRC_VERSION_RX = re.compile(PREFIX + r'VERSION( +:| +|\n)(?P<target>[^\n ]+|)')
hunk ./irc.py 113
+ (IRC_VERSION_RX, self.handle_irc_version, True, False),
hunk ./irc.py 261
+ async def handle_irc_version(self, user, target):
+ self.logger.debug('Handling VERSION: %s', target)
+
+ tgt = target.lower()
+ if not tgt or tgt == self.hostname or tgt in self.users.keys():
+ await self.reply_code(user, 'RPL_VERSION', (VERSION, self.hostname))
+ await self.send_isupport(user)
+ else:
+ await self.reply_code(user, 'ERR_NOSUCHSERVER', (target,))
+
hunk ./irc.py 316
- await self.reply_code(user, 'RPL_ISUPPORT', (str(CHAN_MAX_LENGHT), str(NICK_MAX_LENGTH)))
+ await self.send_isupport(user)
hunk ./irc.py 333
+ async def send_isupport(self, user):
+ await self.reply_code(user, 'RPL_ISUPPORT', (CHAN_MAX_LENGHT, NICK_MAX_LENGTH))
+
hunk ./irc_replies.py 21
+ 'RPL_VERSION': ('351', 'irgramd-{} {} :IRC to Telegram gateway'),