Add message reply&answer methods for dice

This commit is contained in:
Alex Root Junior 2020-04-11 23:06:41 +03:00
parent 82f89b9c1d
commit e4cd4c1763
2 changed files with 48 additions and 0 deletions

View file

@ -50,6 +50,7 @@ if TYPE_CHECKING: # pragma: no cover
SendMessage,
SendPhoto,
SendPoll,
SendDice,
SendSticker,
SendVenue,
SendVideo,
@ -1084,6 +1085,52 @@ class Message(TelegramObject):
reply_markup=reply_markup,
)
def reply_dice(
self,
disable_notification: Optional[bool] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None,
) -> SendDice:
"""
Reply with dice
:param disable_notification:
:param reply_markup:
:return:
"""
from ..methods import SendDice
return SendDice(
chat_id=self.chat.id,
disable_notification=disable_notification,
reply_to_message_id=self.message_id,
reply_markup=reply_markup,
)
def answer_dice(
self,
disable_notification: Optional[bool] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None,
) -> SendDice:
"""
Answer with dice
:param disable_notification:
:param reply_markup:
:return:
"""
from ..methods import SendDice
return SendDice(
chat_id=self.chat.id,
disable_notification=disable_notification,
reply_to_message_id=None,
reply_markup=reply_markup,
)
def reply_sticker(
self,
sticker: Union[InputFile, str],

View file

@ -92,6 +92,7 @@ This methods has the same specification with the API but without `chat_id` and `
| `reply_video_note` | `answer_video_note` | [Bot.send_video_note](../methods/send_video_note.md) | Reply or Answer with video_note |
| `reply_venue` | `answer_venue` | [Bot.send_venue](../methods/send_venue.md) | Reply or Answer with venue |
| `reply_poll` | `answer_poll` | [Bot.send_poll](../methods/send_poll.md) | Reply or Answer with poll |
| `reply_dice` | `answer_dice` | [Bot.send_dice](../methods/send_dice.md) | Reply or Answer with dice |
| `reply_invoice` | `answer_invoice` | [Bot.send_invoice](../methods/send_invoice.md) | Reply or Answer with invoice |