Skip to content

Overhaul & extension of constants #2104

@Bibo-Joshi

Description

@Bibo-Joshi

We have constants in different locations, e.g.

  • telegram.constants
  • class attributes of telegram.ParseMode
  • class attributes of telegram.Dice

That should be unified, i.e.:

  • Gather all constants in telegram.constants (I guess a regex-search for SCREAMING_SNAIL_CASE should do the trick …)
  • Repace the class attributes by links to the constant from telegram.constant, (e.g. ParseMode.HTML = constants.PARSE_MODE_HTML)
  • Add additional links, where suitable (e.g. Message.MAX_LENGTH = constants.MAX_MESSAGE_LENGTH)

Moreover, in light of the recent TG update, we should add

  • constants for user ID 777000 and 1087968824, which act as senders for forwarded channel posts and messages from anonymous admins (see here)
  • Add properties is_anonymous_admin and is_service_chat (or similar namings) to User and Chat that compare the user/chat_id to the IDs menotioned above

Edit: there should be notes on the constants, if they are not documented. And going through the docs to see if there are constants not covered already probably won't hurt …

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions