Example #1
0
def mention(to, nama):
    aa = ""
    bb = ""
    strt = int(14)
    akh = int(14)
    nm = nama
    for mm in nm:
        akh = akh + 2
        aa += """{"S":""" + json.dumps(str(strt)) + ""","E":""" + json.dumps(
            str(akh)) + ""","M":""" + json.dumps(mm) + "}," ""
        strt = strt + 6
        akh = akh + 4
        bb += "\xe2\x95\xa0 @x \n"
    aa = (aa[:int(len(aa) - 1)])
    msg = Message()
    msg.to = to
    msg.text = "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n" + bb + "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90"
    msg.contentMetadata = {
        'MENTION': '{"MENTIONEES":[' + aa + ']}',
        'EMTVER': '4'
    }
    print("[Command] Tag All")
    try:
        cl.sendMessage(msg)
    except Exception as error:
        print(error)
Example #2
0
 def sendLocation(self, to, latitude, longitude, address, title):
     msg = Message()
     msg.to = to
     msg.contentMetadata = {}
     msg.location = Location(latitude=latitude,
                             longitude=longitude,
                             address=address,
                             title=title,
                             phone=None)
     return self.talk.sendMessage(0, msg)
Example #3
0
 def sendFooter2(self, to, text, customIcon, customName, customLink):
     msg = Message()
     msg.to = to
     msg.text = text
     msg.contentMetadata = {
         'AGENT_ICON': customIcon,
         'AGENT_NAME': customName,
         'AGENT_LINK': customLink
     }
     return self.talk.sendMessage(0, msg)
Example #4
0
 def sendMessageWithFooter1(self, to, text, link, icon, footer):
     footer = Message()
     footer.to = to
     footer.contentMetadata = {
         'AGENT_LINK': str(link),
         'AGENT_ICON': str(icon),
         'AGENT_NAME': str(footer)
     }
     footer.text = text
     return self.talk.sendMessage(0, footer)
Example #5
0
 def sendFooter(self, to, text, name):
     msg = Message()
     msg.to = to
     msg.text = text
     msg.contentMetadata = {
         'AGENT_ICON':
         "http://dl.profile.line-cdn.net/" + self.getProfile().picturePath,
         'AGENT_NAME': name,
         'AGENT_LINK': 'https://line.me/ti/p/~akugapunya.idline'
     }
     return self.talk.sendMessage(0, msg)
Example #6
0
 def sendMessageWithFooter2(self, to, text, link, name):
     msg = Message()
     msg.to = to
     msg.text = text
     msg.contentMetadata = {
         'AGENT_ICON':
         "http://dl.profile.line-cdn.net/" + self.getProfile().picturePath,
         'AGENT_NAME': name,
         'AGENT_LINK': link
     }
     return self.talk.sendMessage(0, msg)
Example #7
0
 def sendMessageWithFooter(self,
                           to,
                           text,
                           title=None,
                           link=None,
                           iconlink=None,
                           contentMetadata={}):
     msg = Message()
     msg.to, msg._from = to, self.profile.mid
     msg.text = text
     msg.contentType = 0
     msg.contentMetadata = self.generateMessageFooter(title, link, iconlink)
     if contentMetadata:
         msg.contentMetadata.update(contentMetadata)
     if to not in self._messageReq:
         self._messageReq[to] = -1
     self._messageReq[to] += 1
     return self.talk.sendMessage(self._messageReq[to], msg)
Example #8
0
 def sendMessageMusic(self,
                      to,
                      title=None,
                      subText=None,
                      url=None,
                      iconurl=None,
                      contentMetadata={}):
     """
     a : Android
     i : Ios
     """
     self.profile = self.getProfile()
     self.userTicket = self.generateUserTicket()
     title = title if title else 'LINE MUSIC'
     subText = subText if subText else self.profile.displayName
     url = url if url else 'line://ti/p/' + self.userTicket
     iconurl = iconurl if iconurl else 'https://obs.line-apps.com/os/p/%s' % self.profile.mid
     msg = Message()
     msg.to, msg._from = to, self.profile.mid
     msg.text = title
     msg.contentType = 19
     msg.contentMetadata = {
         'text': title,
         'subText': subText,
         'a-installUrl': url,
         'i-installUrl': url,
         'a-linkUri': url,
         'i-linkUri': url,
         'linkUri': url,
         'previewUrl': iconurl,
         'type': 'mt',
         'a-packageName': 'com.spotify.music',
         'countryCode': 'JP',
         'id': 'mt000000000a6b79f9'
     }
     if contentMetadata:
         msg.contentMetadata.update(contentMetadata)
     if to not in self._messageReq:
         self._messageReq[to] = -1
     self._messageReq[to] += 1
     return self.talk.sendMessage(self._messageReq[to], msg)