-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ def sendMessage(to, text, contentMetadata={}, contentType=0): | |
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mwahyu
via email
|
||
def NOTIFIED_ADD_CONTACT(op): | ||
try: | ||
sendMessage(op.param1, client.getContact(op.param1).displayName + "Thanks for add") | ||
sendMessage(op.param1, client.getContact(op.param1).displayName + "謝謝加入~~ Thanks for add") | ||
except Exception as e: | ||
print e | ||
print ("\n\nNOTIFIED_ADD_CONTACT\n\n") | ||
|
@@ -50,7 +50,7 @@ def NOTIFIED_ADD_CONTACT(op): | |
def NOTIFIED_ACCEPT_GROUP_INVITATION(op): | ||
#print op | ||
try: | ||
sendMessage(op.param1, client.getContact(op.param2).displayName + "WELCOME to " + group.name) | ||
sendMessage(op.param1, client.getContact(op.param2).displayName + "歡迎來到 " + group.name) | ||
except Exception as e: | ||
print e | ||
print ("\n\nNOTIFIED_ACCEPT_GROUP_INVITATION\n\n") | ||
|
@@ -60,7 +60,7 @@ def NOTIFIED_ACCEPT_GROUP_INVITATION(op): | |
|
||
def NOTIFIED_KICKOUT_FROM_GROUP(op): | ||
This comment has been minimized.
Sorry, something went wrong. |
||
try: | ||
sendMessage(op.param1, client.getContact(op.param3).displayName + " Good Bye\n(*´・ω・*)") | ||
sendMessage(op.param1, client.getContact(op.param3).displayName + " 被踢了呢><!") | ||
except Exception as e: | ||
print e | ||
print ("\n\nNOTIFIED_KICKOUT_FROM_GROUP\n\n") | ||
|
@@ -70,7 +70,7 @@ def NOTIFIED_KICKOUT_FROM_GROUP(op): | |
|
||
def NOTIFIED_LEAVE_GROUP(op): | ||
try: | ||
sendMessage(op.param1, client.getContact(op.param2).displayName + " Good Bye\n(*´・ω・*)") | ||
sendMessage(op.param1, client.getContact(op.param2).displayName + " 再見囉") | ||
except Exception as e: | ||
print e | ||
print ("\n\nNOTIFIED_LEAVE_GROUP\n\n") | ||
|
@@ -141,11 +141,11 @@ def SEND_MESSAGE(op): | |
sendMessage(msg.to, msg.to) | ||
if msg.text == "ginfo": | ||
group = client.getGroup(msg.to) | ||
md = "[Group Name]\n" + group.name + "\n\n[gid]\n" + group.id + "\n\n[Group Picture]\nhttp://dl.profile.line-cdn.net/" + group.pictureStatus | ||
if group.preventJoinByTicket is False: md += "\n\nInvitationURL: Permitted\n" | ||
else: md += "\n\nInvitationURL: Refusing\n" | ||
if group.invitee is None: md += "\nMembers: " + str(len(group.members)) + "人\n\nInviting: 0People" | ||
else: md += "\nMembers: " + str(len(group.members)) + "People\nInvited: " + str(len(group.invitee)) + "People" | ||
md = "[群組名稱]\n" + group.name + "\n\n[gid]\n" + group.id + "\n\n[群組照片]\nhttp://dl.profile.line-cdn.net/" + group.pictureStatus | ||
if group.preventJoinByTicket is False: md += "\n\n群組URL: Permitted\n" | ||
else: md += "\n\n群組URL: Refusing\n" | ||
if group.invitee is None: md += "\n成員人數: " + str(len(group.members)) + "人\n\n招待中: 0人" | ||
else: md += "\n成員人數: " + str(len(group.members)) + "人\n招待中: " + str(len(group.invitee)) + "人" | ||
sendMessage(msg.to,md) | ||
if "gname:" in msg.text: | ||
key = msg.text[22:] | ||
|
@@ -155,48 +155,48 @@ def SEND_MESSAGE(op): | |
sendMessage(msg.to,"Group Name"+key+"Canged to") | ||
if msg.text == "url": | ||
sendMessage(msg.to,"line://ti/g/" + client._client.reissueGroupTicket(msg.to)) | ||
if msg.text == "open": | ||
if msg.text == "urlon": | ||
group = client.getGroup(msg.to) | ||
if group.preventJoinByTicket == False: | ||
sendMessage(msg.to, "already open") | ||
sendMessage(msg.to, "URL 已開啟") | ||
else: | ||
group.preventJoinByTicket = False | ||
client.updateGroup(group) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
sendMessage(msg.to, "URL Open") | ||
if msg.text == "close": | ||
sendMessage(msg.to, "URL 已開啟") | ||
if msg.text == "urloff": | ||
group = client.getGroup(msg.to) | ||
if group.preventJoinByTicket == True: | ||
sendMessage(msg.to, "already close") | ||
sendMessage(msg.to, "URL 已關閉") | ||
else: | ||
group.preventJoinByTicket = True | ||
client.updateGroup(group) | ||
sendMessage(msg.to, "URL close") | ||
sendMessage(msg.to, "URL 已關閉") | ||
if "kick:" in msg.text: | ||
key = msg.text[5:] | ||
client.kickoutFromGroup(msg.to, [key]) | ||
contact = client.getContact(key) | ||
sendMessage(msg.to, ""+contact.displayName+"sorry") | ||
if "nk:" in msg.text: | ||
sendMessage(msg.to, ""+contact.displayName+"抱歉囉><") | ||
if "Nk:" in msg.text: | ||
key = msg.text[3:] | ||
group = client.getGroup(msg.to) | ||
Names = [contact.displayName for contact in group.members] | ||
Mids = [contact.mid for contact in group.members] | ||
if key in Names: | ||
kazu = Names.index(key) | ||
sendMessage(msg.to, "Bye") | ||
sendMessage(msg.to, "掰掰拉^^") | ||
client.kickoutFromGroup(msg.to, [""+Mids[kazu]+""]) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
contact = client.getContact(Mids[kazu]) | ||
sendMessage(msg.to, ""+contact.displayName+" Sorry") | ||
sendMessage(msg.to, ""+contact.displayName+" 抱歉囉><") | ||
else: | ||
sendMessage(msg.to, "wtf?") | ||
sendMessage(msg.to, "找不到成員><") | ||
if msg.text == "cancel": | ||
group = client.getGroup(msg.to) | ||
if group.invitee is None: | ||
sendMessage(op.message.to, "No one is inviting.") | ||
sendMessage(op.message.to, "招待中沒人><") | ||
else: | ||
gInviMids = [contact.mid for contact in group.invitee] | ||
client.cancelGroupInvitation(msg.to, gInviMids) | ||
sendMessage(msg.to, str(len(group.invitee)) + " Done") | ||
sendMessage(msg.to, str(len(group.invitee)) + " 人 已取消") | ||
if "invite:" in msg.text: | ||
key = msg.text[-33:] | ||
This comment has been minimized.
Sorry, something went wrong. |
||
client.findAndAddContactsByMid(key) | ||
|
@@ -215,11 +215,11 @@ def SEND_MESSAGE(op): | |
contact = client.getContact(key) | ||
sendMessage(msg.to, ""+contact.displayName+"'s contact") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
if msg.text == "time": | ||
sendMessage(msg.to, "Current time is" + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + "is") | ||
sendMessage(msg.to, "戰神報時: " + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + " ~") | ||
if msg.text == "gift": | ||
sendMessage(msg.to, text="gift sent", contentMetadata=None, contentType=9) | ||
if msg.text == "set": | ||
sendMessage(msg.to, "I have set a read point ♪\n「tes」I will show you who I have read ♪") | ||
sendMessage(msg.to, "已抓已讀點♪") | ||
try: | ||
del wait['readPoint'][msg.to] | ||
del wait['readMember'][msg.to] | ||
|
@@ -230,7 +230,7 @@ def SEND_MESSAGE(op): | |
wait['setTime'][msg.to] = datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S') | ||
wait['ROM'][msg.to] = {} | ||
print wait | ||
if msg.text == "tes": | ||
if msg.text == "read": | ||
if msg.to in wait['readPoint']: | ||
if wait["ROM"][msg.to].items() == []: | ||
chiya = "" | ||
|
@@ -240,9 +240,9 @@ def SEND_MESSAGE(op): | |
print rom | ||
chiya += rom[1] + "\n" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
sendMessage(msg.to, "People who readed %s\nthat's it\n\nPeople who have ignored reads\n%sIt is abnormal ♪\n\nReading point creation date n time:\n[%s]" % (wait['readMember'][msg.to],chiya,setTime[msg.to])) | ||
sendMessage(msg.to, "已讀的人 %s\nthat's it\n\n已讀不回的人\n%s >< ♪\n\n抓已讀點的時間:\n[%s]" % (wait['readMember'][msg.to],chiya,setTime[msg.to])) | ||
else: | ||
sendMessage(msg.to, "An already read point has not been set.\n「set」you can send ♪ read point will be created ♪") | ||
sendMessage(msg.to, "還沒抓已讀點喔♪") | ||
else: | ||
pass | ||
else: | ||
|
1 comment
on commit d2ebcca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello
Azyzal