Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Extend Support for Convenience Types in Bot Methods #4580

Labels
⚙️ bot-apiaffected functionality: bot-api⚙️ testsaffected functionality: tests⚙️ type-hintingaffected functionality: type-hinting🔌 enhancementpr description: enhancement
@Bibo-Joshi

Description

@Bibo-Joshi

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

Intest_official we currently allow convenience input types only forsend_* methods:

# 2) HANDLING OTHER TYPES:
# Special case for send_* methods where we accept more types than the official API:
elifptb_param.nameinPTCE.ADDITIONAL_TYPESandobj.__name__.startswith("send"):
log("Checking that `%s` has an additional argument!\n",ptb_param.name)
mapped_type=mapped_type|PTCE.ADDITIONAL_TYPES[ptb_param.name]

ADDITIONAL_TYPES= {
"photo":PhotoSize,
"video":Video,
"video_note":VideoNote,
"audio":Audio,
"document":Document,
"animation":Animation,
"voice":Voice,
"sticker":Sticker,
}

Removing theobj.__name__.startswith("send") reveals that there are a few more parameters that could use convenience types.

Describe the solution you'd like

  • Set up the "additional types" excetpions in test_official such that they can either be defined globally or per method, remove theobj.__name__ check
  • add support for convenience types where possible

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚙️ bot-apiaffected functionality: bot-api⚙️ testsaffected functionality: tests⚙️ type-hintingaffected functionality: type-hinting🔌 enhancementpr description: enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp