当前位置: 首页>>代码示例>>Python>>正文


Python ttypes.Message方法代码示例

本文整理汇总了Python中akad.ttypes.Message方法的典型用法代码示例。如果您正苦于以下问题:Python ttypes.Message方法的具体用法?Python ttypes.Message怎么用?Python ttypes.Message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在akad.ttypes的用法示例。


在下文中一共展示了ttypes.Message方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sendLocation

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendLocation(self, to, address, latitude, longitude, phone=None, contentMetadata={}):
        msg = Message()
        msg.to, msg._from = to, self.profile.mid
        msg.text = "Location by Hello World"
        msg.contentType, msg.contentMetadata = 0, contentMetadata
        location = Location()
        location.address = address
        location.phone = phone
        location.latitude = float(latitude)
        location.longitude = float(longitude)
        location.title = "Location"
        msg.location = location
        if to not in self._messageReq:
            self._messageReq[to] = -1
        self._messageReq[to] += 1
        return self.talk.sendMessage(self._messageReq[to], msg) 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:18,代码来源:talk.py

示例2: sendMessage

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendMessage(self, to, text, contentMetadata={}, contentType=0):
        msg = Message()
        msg.to, msg._from = to, self.profile.mid
        msg.text = text
        msg.contentType, msg.contentMetadata = contentType, contentMetadata
        if to not in self._messageReq:
            self._messageReq[to] = -1
        self._messageReq[to] += 1
        return self.talk.sendMessage(self._messageReq[to], msg) 
开发者ID:arifistifik,项目名称:dpk,代码行数:11,代码来源:talk.py

示例3: sendMessageAwaitCommit

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendMessageAwaitCommit(self, to, text, contentMetadata={}, contentType=0):
        msg = Message()
        msg.to, msg._from = to, self.profile.mid
        msg.text = text
        msg.contentType, msg.contentMetadata = contentType, contentMetadata
        if to not in self._messageReq:
            self._messageReq[to] = -1
        self._messageReq[to] += 1
        return self.talk.sendMessageAwaitCommit(self._messageReq[to], msg) 
开发者ID:arifistifik,项目名称:dpk,代码行数:11,代码来源:talk.py

示例4: sendText

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendText(self, Tomid, text):
        msg = Message()
        msg.to = Tomid
        msg.text = text
        return self.talk.sendMessage(0, msg) 
开发者ID:arifistifik,项目名称:dpk,代码行数:7,代码来源:talk.py

示例5: kedapkedip

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def kedapkedip(self, Tomid, text):
        msg = Message()
        msg.to = Tomid
        t1 = "\xf4\x80\xb0\x82\xf4\x80\xb0\x82\xf4\x80\xb0\x82\xf4\x80\xb0\x82\xf4\x80\xa0\x81\xf4\x80\xa0\x81\xf4\x80\xa0\x81"
        t2 = "\xf4\x80\x82\xb3\xf4\x8f\xbf\xbf"
        DPK = t1 + text + t2
        msg.text = DPK.replace("\n", " ")
        return self.talk.sendMessage(0, msg) 
开发者ID:arifistifik,项目名称:dpk,代码行数:10,代码来源:talk.py

示例6: textDPK

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def textDPK(self, Tomid, text):
        msg = Message()
        msg.to = Tomid
        t1 = "̍"
        t2 = "̕"
        DPK = t1 + text + t2
        msg.text = DPK.replace("\n", " ")
        return self.talk.sendMessage(0, msg) 
开发者ID:arifistifik,项目名称:dpk,代码行数:10,代码来源:talk.py

示例7: mention

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def mention(self, to, nama):
        aa = ""
        bb = ""
        strt = int(0)
        akh = int(0)
        nm = nama
        myid = self._client.getProfile().mid
        if myid in nm:    
          nm.remove(myid)
        for mm in nm:
          akh = akh + 6
          aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},"""
          strt = strt + 7
          akh = akh + 1
          bb += "@nrik \n"
        aa = (aa[:int(len(aa)-1)])
        text = bb
        try:
            msg = Message()
            msg.to = to
            msg.text = text
            msg.contentMetadata = {'MENTION':'{"MENTIONEES":['+aa+']}'}
            msg.contentType = 0
            self._client.sendMessage(0, msg)
        except Exception as error:
           print(error, 'def Mention') 
开发者ID:soppeng29,项目名称:simpleSB,代码行数:28,代码来源:client.py

示例8: sendText

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendText(self, Tomid, text):
        msg = Message()
        msg.to = Tomid
        msg.text = text
        return self._client.sendMessage(0, msg) 
开发者ID:soppeng29,项目名称:simpleSB,代码行数:7,代码来源:client.py

示例9: sendMessage

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendMessage(self, to, text, contentMetadata={}, contentType=0):
        msg = Message()
        msg.to, msg._from = to, self.profile.mid
        msg.text = text
        msg.contentType, msg.contentMetadata = contentType, contentMetadata
        if to not in self._messageReq:
            self._messageReq[to] = -1
        self._messageReq[to] += 1
        return self._client.sendMessage(self._messageReq[to], msg) 
开发者ID:soppeng29,项目名称:simpleSB,代码行数:11,代码来源:client.py

示例10: sendMessageMusic

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
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 'https://line.me/R/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) 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:37,代码来源:talk.py

示例11: sendMessageWithFooter

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
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) 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:14,代码来源:talk.py

示例12: generateReplyMessage

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def generateReplyMessage(self, relatedMessageId):
        msg = Message()
        msg.relatedMessageServiceCode = 1
        msg.messageRelationType = 3
        msg.relatedMessageId = str(relatedMessageId)
        return msg 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:8,代码来源:talk.py

示例13: sendText

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendText(self, Tomid, text):
        msg = Message()
        msg.to = Tomid
        msg.text = text

        return self.talk.sendMessage(0, msg) 
开发者ID:Aditmadzs,项目名称:Protect4,代码行数:8,代码来源:talk.py

示例14: sendMessage

# 需要导入模块: from akad import ttypes [as 别名]
# 或者: from akad.ttypes import Message [as 别名]
def sendMessage(to, Message, contentMetadata={}, contentType=0):
    mes = Message()
    mes.to, mes._from = to, profile.mid
    mes.text = text
    mes.contentType, mes.contentMetadata = contentType, contentMetadata
    if to not in messageReq:
        messageReq[to] = -1
    messageReq[to] += 1 
开发者ID:arifistifik,项目名称:sb,代码行数:10,代码来源:sb.py


注:本文中的akad.ttypes.Message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。