telegram: Relocate is_bot() method, to have get_* methods together
patch 5b3071c8f389341108b84aad6b91351a118cddb0
Author: E. Bosch <presidev@AT@gmail.com>
Date: Thu Apr 20 01:49:15 CEST 2023
* telegram: Relocate is_bot() method, to have get_* methods together
hunk ./telegram.py 246
- async def is_bot(self, irc_nick, tid=None):
- user = self.irc.users[irc_nick]
- if user.stream or user.is_service:
- bot = False
- else:
- bot = user.bot
- if bot == None:
- tid = self.get_tid(irc_nick, tid)
- tg_user = await self.telegram_client.get_entity(tid)
- bot = tg_user.bot
- user.bot = bot
- return bot
-
hunk ./telegram.py 301
+ async def is_bot(self, irc_nick, tid=None):
+ user = self.irc.users[irc_nick]
+ if user.stream or user.is_service:
+ bot = False
+ else:
+ bot = user.bot
+ if bot == None:
+ tid = self.get_tid(irc_nick, tid)
+ tg_user = await self.telegram_client.get_entity(tid)
+ bot = tg_user.bot
+ user.bot = bot
+ return bot
+