irc: Handle messages to inexistent users and to users in other IRC
patch 34113fbedae0bddb28721fc1d5a879ef9df9ca89
Author: E. Bosch <presidev@AT@gmail.com>
Date: Fri Feb 4 18:21:49 CET 2022
* irc: Handle messages to inexistent users and to users in other IRC
connections (these messages won't be sent by design)
hunk ./irc.py 366
- if tgt not in self.iid_to_tid:
- print('TODO: handle error')
-
- telegram_id = self.iid_to_tid[tgt]
- await self.tg.telegram_client.send_message(telegram_id, message)
+ if tgt in self.iid_to_tid:
+ telegram_id = self.iid_to_tid[tgt]
+ await self.tg.telegram_client.send_message(telegram_id, message)
+ else:
+ await self.reply_code(user, 'ERR_NOSUCHNICK', (target,))
hunk ./irc_replies.py 34
- 'ERR_NOSUCHNICK': ('401', '{} :Nick not found'),
+ 'ERR_NOSUCHNICK': ('401', '{} :Nick not found or available'),