本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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')
示例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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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