예제 #1
0
 def send_text_plus(self,to:str, text: str, keyboard: Keyboard = None, min_api_version=None, tracking_data: str = None):
     return self.api.send_message(
         to=to,
         message=TextMessage(
             text=text,
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data
         ))
예제 #2
0
 def send_sticker(self, sticker_id: int, keyboard: Keyboard = None, min_api_version=None, tracking_data: str = None):
     return self.api.send_message(
         to=self.sender.id,
         message=StickerMessage(
             sticker_id=sticker_id,
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data
         )
     )
예제 #3
0
 def send_contact(self, name: str, phone_number: str, avatar: str = None, keyboard: Keyboard = None,
                  min_api_version=None, tracking_data: str = None):
     return self.api.send_message(
         to=self.sender.id,
         message=ContactMessage(
             contact=Contact(name=name, phone_number=phone_number, avatar=avatar),
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data
         )
     )
예제 #4
0
 def send_rich_media(self,
                     rich_media: Carousel,
                     keyboard: Keyboard = None,
                     min_api_version: int = 2,
                     tracking_data: str = None):
     return self.api.send_message(
         to=self.sender.id,
         message=RichMediaMessage(
             rich_media=rich_media.to_dict(),
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data))
예제 #5
0
 def send_url(self,
              url: str,
              keyboard: Keyboard = None,
              min_api_version=None,
              tracking_data: str = None):
     return self.api.send_message(
         to=self.sender.id,
         message=URLMessage(
             media=url,
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data))
예제 #6
0
 def send_location(self,
                   lat: float,
                   lon: float,
                   keyboard: Keyboard = None,
                   min_api_version=None,
                   tracking_data: str = None):
     return self.api.send_message(
         to=self.sender.id,
         message=LocationMessage(
             location=Location(lat, lon),
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data))
예제 #7
0
 def send_video(self,
                media: str,
                size: int,
                thumbnail: str = None,
                duration: int = None,
                text: str = None,
                keyboard: Keyboard = None,
                min_api_version=None,
                tracking_data: str = None):
     return self.api.send_message(
         to=self.sender.id,
         message=VideoMessage(
             media=media,
             size=size,
             thumbnail=thumbnail,
             duration=duration,
             text=text,
             keyboard=keyboard.to_dict() if keyboard else None,
             min_api_version=min_api_version,
             tracking_data=tracking_data))