-
Notifications
You must be signed in to change notification settings - Fork 6k
Labels
ℹ️ good-first-issueinformation: good-first-issueinformation: good-first-issue
Description
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
context.bot in update.effective_message.new_chat_membersCurrently 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 returnself.bot == otherand document the behaviour accordingly - we need to make sure that
self.botis already set. For theBot.{id, username, …}properties, that's currently done with the@infodecorator. I think it would be cleaner to just convertself.botinto a property that callsself.get_me()if needed.
Metadata
Metadata
Assignees
Labels
ℹ️ good-first-issueinformation: good-first-issueinformation: good-first-issue