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

TypeError: Gift.__init__() got an unexpected keyword argument 'upgrade_star_count' #4637

@l-Il

Description

@l-Il

Steps to Reproduce

context.bot.get_available_gifts()

Expected behaviour

you get json from the server that is parsed with Gift class

Actual behaviour

TypeError: Gift.init() got an unexpected keyword argument 'upgrade_star_count'

Operating System

ubuntu

Version of Python, python-telegram-bot & dependencies

Requirement already satisfied: python-telegram-botin  (21.9)Requirement already satisfied: httpx~=0.27in  (from python-telegram-bot) (0.27.2)Requirement already satisfied: anyioin  (from httpx~=0.27->python-telegram-bot) (4.4.0)Requirement already satisfied: certifiin  (from httpx~=0.27->python-telegram-bot) (2023.11.17)Requirement already satisfied: httpcore==1.*in  (from httpx~=0.27->python-telegram-bot) (1.0.5)Requirement already satisfied: idnain  (from httpx~=0.27->python-telegram-bot) (3.6)Requirement already satisfied: sniffioin  (from httpx~=0.27->python-telegram-bot) (1.3.1)Requirement already satisfied: h11<0.15,>=0.13in  (from httpcore==1.*->httpx~=0.27->python-telegram-bot) (0.14.0)

Relevant log output

Noerrorhandlersareregistered,loggingexception.Traceback (mostrecentcalllast):File"/home/USER/.local/lib/python3.12/site-packages/telegram/ext/_application.py",line1325,inprocess_updateawaitcoroutineFile"/home/USER/.local/lib/python3.12/site-packages/telegram/ext/_handlers/basehandler.py",line158,inhandle_updatereturnawaitself.callback(update,context)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/bot.py",line65,ingiftsgifts=awaitcontext.bot.get_available_gifts()^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/ext/_extbot.py",line4453,inget_available_giftsreturnawaitsuper().get_available_gifts(^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/_bot.py",line9670,inget_available_giftsreturnGifts.de_json(# type: ignore[return-value]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/_gifts.py",line135,inde_jsondata["gifts"]=Gift.de_list(data.get("gifts"),bot)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/_telegramobject.py",line465,inde_listreturntuple(objforobjin (cls.de_json(d,bot)fordindata)ifobjisnotNone)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/_telegramobject.py",line465,in<genexpr>returntuple(objforobjin (cls.de_json(d,bot)fordindata)ifobjisnotNone)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/_telegramobject.py",line465,in<genexpr>returntuple(objforobjin (cls.de_json(d,bot)fordindata)ifobjisnotNone)^^^^^^^^^^^^^^^^^^^File"/home/USER/.local/lib/python3.12/site-packages/telegram/_gifts.py",line93,inde_jsonreturncls(**data)^^^^^^^^^^^TypeError:Gift.__init__()gotanunexpectedkeywordargument'upgrade_star_count'

Additional Context

after a recent update of the Telegram API, "get_available_gifts" was added to the Gift class, which is not in the library, so any requests with the get_available_gifts() method end with an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp