messages/telegram.py
def _send_content(self, method="/sendMessage"):
        """send via HTTP Post."""
        url = self.base_url + method

        try:
            resp = requests.post(url, json=self.message)
            resp.raise_for_status()
        except requests.exceptions.HTTPError as e:
            raise MessageSendError(e)

        if self.verbose:
            if method == "/sendMessage":
                content_type = "Message body"
            elif method == "/sendDocument":
                content_type = "Attachment: " + self.message["document"]
            print(timestamp(), content_type, "sent.")
def _send_content(self, method="/sendMessage"):
        url = self.base_url + method

        try:
            resp = requests.post(url, json=self.message)
            resp.raise_for_status()
        except requests.exceptions.HTTPError as e:
            raise MessageSendError(e)

        if self.verbose:
            if method == "/sendMessage":
                content_type = "Message body"
            elif method == "/sendDocument":
                content_type = "Attachment: " + self.message["document"]
            print(timestamp(), content_type, "sent.")
def _send_content ( self , method = "/sendMessage" ) : url = self . base_url + method try : resp = requests . post ( url , json = self . message ) resp . raise_for_status ( ) except requests . exceptions . HTTPError as e : raise MessageSendError ( e ) if self . verbose : if method == "/sendMessage" : content_type = "Message body" elif method == "/sendDocument" : content_type = "Attachment: " + self . message [ "document" ] print ( timestamp ( ) , content_type , "sent." )
send via HTTP Post.
send via HTTP Post .