Added __call__ method to TelegramMethod class. (#1616)

* Added __call__ method to TelegramMethod class.

* Added rst.

* Moved rst.

* Deleted __call__, changed exception text.

* Changed pull request desc text
This commit is contained in:
qvvonk 2024-12-15 17:00:21 +03:00 committed by GitHub
parent 494e07a75a
commit f2e305e92a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

1
CHANGES/1616.bugfix.rst Normal file
View file

@ -0,0 +1 @@
Corrected the exception text of `aiogram.methods.base.TelegramMethod.__await__` method.

View file

@ -90,6 +90,6 @@ class TelegramMethod(BotContextController, BaseModel, Generic[TelegramType], ABC
"This method is not mounted to a any bot instance, please call it explicilty " "This method is not mounted to a any bot instance, please call it explicilty "
"with bot instance `await bot(method)`\n" "with bot instance `await bot(method)`\n"
"or mount method to a bot instance `method.as_(bot)` " "or mount method to a bot instance `method.as_(bot)` "
"and then call it `await method()`" "and then call it `await method`"
) )
return self.emit(bot).__await__() return self.emit(bot).__await__()