Fix a incompatibility with "from_id" intruduced in Telethon 1.17
patch 83c559617ebe7e914b931b4b00a3f7e2c897c99a
Author: E. Bosch <presidev@AT@gmail.com>
Date: Fri Nov 20 00:47:57 CET 2020
* Fix a incompatibility with "from_id" intruduced in Telethon 1.17
This was breaking the reception of messages
See https://docs.telethon.dev/en/latest/misc/changelog.html?highlight=from_id#channel-comments-and-anonymous-admins-v1-17
diff -rN -u old-irgramd/irc.py new-irgramd/irc.py
--- old-irgramd/irc.py 2024-11-23 05:51:48.623960465 +0100
+++ new-irgramd/irc.py 2024-11-23 05:51:48.623960465 +0100
@@ -282,7 +282,7 @@
async def handle_telegram_private_message(self, event):
self.logger.debug('Handling Telegram Private Message: %s', event)
- nick = await self.get_irc_nick_from_telegram_id(event.from_id)
+ nick = await self.get_irc_nick_from_telegram_id(event.sender_id)
for message in event.message.message.splitlines():
await self.send_irc_command(':{} PRIVMSG {} :{}'.format(
self.get_irc_user_mask(nick), self.irc_nick, message
@@ -297,7 +297,7 @@
if channel not in self.irc_channels:
await self.join_irc_channel(self.irc_nick, channel, True)
- nick = await self.get_irc_nick_from_telegram_id(event.from_id)
+ nick = await self.get_irc_nick_from_telegram_id(event.sender_id)
if nick not in self.irc_channels[channel]:
await self.join_irc_channel(nick, channel, False)
@@ -333,7 +333,7 @@
try: # Kick
irc_nick = await self.get_irc_nick_from_telegram_id(event.action_message.action.user_id)
except (IndexError, AttributeError): # Join Channels
- irc_nick = await self.get_irc_nick_from_telegram_id(event.action_message.from_id)
+ irc_nick = await self.get_irc_nick_from_telegram_id(event.action_message.sender_id)
if event.user_added or event.user_joined:
await self.join_irc_channel(irc_nick, irc_channel, False)