Source code for peyk.platforms.bale.methods.edit_message_text

from __future__ import annotations
from ..errors import BaleAPIError
from peyk.transport import FilePayload
from ..models import Message
from typing import Any, Dict, Mapping, Optional, Union

[docs] async def edit_message_text(self, chat_id: Union[int, str], message_id: int, text: str, *, reply_markup: Optional[Mapping[str, object]]=None) -> Message: """Edits message text through the Bale API. Args: chat_id: Identifier of the target chat. message_id: Identifier of the target message. text: Text content supplied to the operation. reply_markup: Keyboard or reply markup attached to the request. Returns: Result produced by the Bale operation.""" 'Implement Bale client method ``edit_message_text``.\n\nArgs:\n Uses the parameter values documented by the method signature.\n\nReturns:\n The value returned by the Bale API after parsing.\n\nRaises:\n BaleAPIError: If the Bale API rejects the request.\n\nExample:\n ``await client.edit_message_text(... )``' payload: Dict[str, object] = {'chat_id': chat_id, 'message_id': message_id, 'text': text} if reply_markup is not None: payload['reply_markup'] = reply_markup result = await self._call('editMessageText', json_body=payload) return Message.from_dict(result)