2020-06-14 18:18:29 +03:00
from __future__ import annotations
from typing import TYPE_CHECKING , Any , Dict , Optional , Union
2019-11-03 22:14:41 +02:00
2019-11-14 00:44:09 +02:00
from . . types import InlineKeyboardMarkup , Message
2019-11-14 14:44:17 +02:00
from . base import Request , TelegramMethod
2019-11-03 22:14:41 +02:00
2021-09-22 00:52:38 +03:00
if TYPE_CHECKING :
2020-06-14 18:18:29 +03:00
from . . client . bot import Bot
2019-11-03 22:14:41 +02:00
class StopMessageLiveLocation ( TelegramMethod [ Union [ Message , bool ] ] ) :
"""
2021-11-08 02:37:37 +02:00
Use this method to stop updating a live location message before * live_period * expires . On success , if the message is not an inline message , the edited : class : ` aiogram . types . message . Message ` is returned , otherwise : code : ` True ` is returned .
2019-11-03 22:14:41 +02:00
Source : https : / / core . telegram . org / bots / api #stopmessagelivelocation
"""
__returning__ = Union [ Message , bool ]
chat_id : Optional [ Union [ int , str ] ] = None
2021-01-26 21:20:52 +02:00
""" Required if *inline_message_id* is not specified. Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) """
2019-11-03 22:14:41 +02:00
message_id : Optional [ int ] = None
2021-01-26 21:20:52 +02:00
""" Required if *inline_message_id* is not specified. Identifier of the message with live location to stop """
2019-11-03 22:14:41 +02:00
inline_message_id : Optional [ str ] = None
2021-01-26 21:20:52 +02:00
""" Required if *chat_id* and *message_id* are not specified. Identifier of the inline message """
2019-11-03 22:14:41 +02:00
reply_markup : Optional [ InlineKeyboardMarkup ] = None
2022-11-06 14:28:21 +02:00
""" A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_. """
2019-11-03 22:14:41 +02:00
2020-06-14 18:18:29 +03:00
def build_request ( self , bot : Bot ) - > Request :
2019-11-14 14:44:17 +02:00
data : Dict [ str , Any ] = self . dict ( )
2019-11-14 00:44:09 +02:00
return Request ( method = " stopMessageLiveLocation " , data = data )