You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tg.Bot didn't get rich comparison in #1724, though there are use cases when comparison of Bot with User objects would be helpful. Most notable when checking if the bot is one of the new chat members reportet in a status update; with rich comparison that would be as easy as
Currently one can use bot_instance.bot, which holds the User instance for comparison, but it's undocumented and unintuitive. Proposal:
Make Bot.__eq__(self, other) basically return self.bot == other and document the behaviour accordingly
we need to make sure that self.bot is already set. For the Bot.{id, username, …} properties, that's currently done with the @info decorator. I think it would be cleaner to just convert self.bot into a property that calls self.get_me() if needed.
The text was updated successfully, but these errors were encountered:
tg.Bot
didn't get rich comparison in #1724, though there are use cases when comparison ofBot
withUser
objects would be helpful. Most notable when checking if the bot is one of the new chat members reportet in a status update; with rich comparison that would be as easy asCurrently one can use
bot_instance.bot
, which holds theUser
instance for comparison, but it's undocumented and unintuitive. Proposal:Bot.__eq__(self, other)
basically returnself.bot == other
and document the behaviour accordinglyself.bot
is already set. For theBot.{id, username, …}
properties, that's currently done with the@info
decorator. I think it would be cleaner to just convertself.bot
into a property that callsself.get_me()
if needed.The text was updated successfully, but these errors were encountered: