def actual_sending(self, sender: PytgbotApiBot, receiver, reply_id): return sender.send_document( receiver, self.file_id, caption=self.caption, reply_to_message_id=reply_id, reply_markup=self.reply_markup, disable_notification=self.disable_notification)
def actual_sending(self, sender: PytgbotApiBot) -> PytgbotApiMessage: assert isinstance(self.reply_id, int) # not DEFAULT_MESSAGE_ID return sender.send_document( chat_id=self.receiver, document=self.file, caption=self.caption, parse_mode=self.parse_mode, reply_to_message_id=self.reply_id, reply_markup=self.reply_markup, disable_notification=self.disable_notification)
def actual_sending(self, sender: PytgbotApiBot, ignore_reply: bool = False) -> PytgbotApiMessage: assert_type_or_raise(self.reply_id, int, None, parameter_name="self.reply_id") # not DEFAULT_MESSAGE_ID return sender.send_document( chat_id=self.receiver, document=self.file, caption=self.caption, parse_mode=self.parse_mode, reply_to_message_id=self.reply_id if not ignore_reply else None, reply_markup=self.reply_markup, disable_notification=self.disable_notification, allow_sending_without_reply=True, )
def send(self, sender: PytgbotApiBot, receiver, reply_id)->PytgbotApiMessage: if self.receiver: receiver = self.receiver # end if if self.reply_id is not DEFAULT_MESSAGE_ID: reply_id = self.reply_id # end if self.prepare_file() try: return sender.send_document( receiver, self.file, caption=self.caption, reply_to_message_id=reply_id, reply_markup=self.reply_markup, disable_notification=self.disable_notification ) except TgApiServerException as e: should_backoff(e) # checks if it should raise an DoRetryException raise # else it just raises as usual
def send(self, sender: PytgbotApiBot, receiver, reply_id) -> PytgbotApiMessage: if self.receiver: receiver = self.receiver # end if if self.reply_id is not DEFAULT_MESSAGE_ID: reply_id = self.reply_id # end if self.prepare_file() try: return sender.send_document( receiver, self.file, caption=self.caption, reply_to_message_id=reply_id, reply_markup=self.reply_markup, disable_notification=self.disable_notification) except TgApiServerException as e: should_backoff(e) # checks if it should raise an DoRetryException raise # else it just raises as usual
def actual_sending(self, sender: PytgbotApiBot, receiver, reply_id): return sender.send_document( receiver, self.file_id, caption=self.caption, reply_to_message_id=reply_id, reply_markup=self.reply_markup, disable_notification=self.disable_notification )