@@ -129,7 +129,7 @@ async def _parse(client, callback_query, users) -> "CallbackQuery":
129129 client = client
130130 )
131131
132- def answer (self , text : str = None , show_alert : bool = None , url : str = None , cache_time : int = 0 ):
132+ async def answer (self , text : str = None , show_alert : bool = None , url : str = None , cache_time : int = 0 ):
133133 """Bound method *answer* of :obj:`CallbackQuery`.
134134
135135 Use this method as a shortcut for:
@@ -165,15 +165,15 @@ def answer(self, text: str = None, show_alert: bool = None, url: str = None, cac
165165 The maximum amount of time in seconds that the result of the callback query may be cached client-side.
166166 Telegram apps will support caching starting in version 3.14. Defaults to 0.
167167 """
168- return self ._client .answer_callback_query (
168+ return await self ._client .answer_callback_query (
169169 callback_query_id = self .id ,
170170 text = text ,
171171 show_alert = show_alert ,
172172 url = url ,
173173 cache_time = cache_time
174174 )
175175
176- def edit_message_text (
176+ async def edit_message_text (
177177 self ,
178178 text : str ,
179179 parse_mode : Union [str , None ] = object ,
@@ -209,7 +209,7 @@ def edit_message_text(
209209 RPCError: In case of a Telegram RPC error.
210210 """
211211 if self .inline_message_id is None :
212- return self ._client .edit_message_text (
212+ return await self ._client .edit_message_text (
213213 chat_id = self .message .chat .id ,
214214 message_id = self .message .message_id ,
215215 text = text ,
@@ -218,15 +218,15 @@ def edit_message_text(
218218 reply_markup = reply_markup
219219 )
220220 else :
221- return self ._client .edit_inline_text (
221+ return await self ._client .edit_inline_text (
222222 inline_message_id = self .inline_message_id ,
223223 text = text ,
224224 parse_mode = parse_mode ,
225225 disable_web_page_preview = disable_web_page_preview ,
226226 reply_markup = reply_markup
227227 )
228228
229- def edit_message_caption (
229+ async def edit_message_caption (
230230 self ,
231231 caption : str ,
232232 parse_mode : Union [str , None ] = object ,
@@ -257,9 +257,9 @@ def edit_message_caption(
257257 Raises:
258258 RPCError: In case of a Telegram RPC error.
259259 """
260- return self .edit_message_text (caption , parse_mode , reply_markup )
260+ return await self .edit_message_text (caption , parse_mode , reply_markup )
261261
262- def edit_message_media (
262+ async def edit_message_media (
263263 self ,
264264 media : "pyrogram.InputMedia" ,
265265 reply_markup : "pyrogram.InlineKeyboardMarkup" = None
@@ -283,20 +283,20 @@ def edit_message_media(
283283 RPCError: In case of a Telegram RPC error.
284284 """
285285 if self .inline_message_id is None :
286- return self ._client .edit_message_media (
286+ return await self ._client .edit_message_media (
287287 chat_id = self .message .chat .id ,
288288 message_id = self .message .message_id ,
289289 media = media ,
290290 reply_markup = reply_markup
291291 )
292292 else :
293- return self ._client .edit_inline_media (
293+ return await self ._client .edit_inline_media (
294294 inline_message_id = self .inline_message_id ,
295295 media = media ,
296296 reply_markup = reply_markup
297297 )
298298
299- def edit_message_reply_markup (
299+ async def edit_message_reply_markup (
300300 self ,
301301 reply_markup : "pyrogram.InlineKeyboardMarkup" = None
302302 ) -> Union ["pyrogram.Message" , bool ]:
@@ -316,13 +316,13 @@ def edit_message_reply_markup(
316316 RPCError: In case of a Telegram RPC error.
317317 """
318318 if self .inline_message_id is None :
319- return self ._client .edit_message_reply_markup (
319+ return await self ._client .edit_message_reply_markup (
320320 chat_id = self .message .chat .id ,
321321 message_id = self .message .message_id ,
322322 reply_markup = reply_markup
323323 )
324324 else :
325- return self ._client .edit_inline_reply_markup (
325+ return await self ._client .edit_inline_reply_markup (
326326 inline_message_id = self .inline_message_id ,
327327 reply_markup = reply_markup
328328 )
0 commit comments