From 80ac37c7e3d8d2ba7ba1f184bb786c11de770cfe Mon Sep 17 00:00:00 2001 From: kirwinkk <31506555+kirwinkk@users.noreply.github.com> Date: Thu, 31 Aug 2017 22:00:41 -0500 Subject: [PATCH 1/6] Update vodkabot.py --- vodkabot.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vodkabot.py b/vodkabot.py index 7caf6dc..ad9a7c2 100644 --- a/vodkabot.py +++ b/vodkabot.py @@ -39,7 +39,7 @@ def sendMessage(to, text, contentMetadata={}, contentType=0): 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 + "謝謝加入") except Exception as e: print e print ("\n\nNOTIFIED_ADD_CONTACT\n\n") @@ -60,7 +60,7 @@ def NOTIFIED_ACCEPT_GROUP_INVITATION(op): def NOTIFIED_KICKOUT_FROM_GROUP(op): 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 + " 戦神跟你說 ByeBye\n(*´・ω・*)") except Exception as e: print e print ("\n\nNOTIFIED_LEAVE_GROUP\n\n") @@ -192,11 +192,11 @@ def SEND_MESSAGE(op): 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:] client.findAndAddContactsByMid(key) @@ -215,11 +215,11 @@ def SEND_MESSAGE(op): contact = client.getContact(key) sendMessage(msg.to, ""+contact.displayName+"'s contact") 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, "I 成功") 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 = "" @@ -242,7 +242,7 @@ def SEND_MESSAGE(op): 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])) 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, "請先set") else: pass else: From ddda86ac30fbfce57e88334aaebc3aa91abdda5e Mon Sep 17 00:00:00 2001 From: kirwinkk <31506555+kirwinkk@users.noreply.github.com> Date: Thu, 31 Aug 2017 23:32:19 -0500 Subject: [PATCH 2/6] Rename vodkabot.py to vodkabot2.py --- vodkabot.py => vodkabot2.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename vodkabot.py => vodkabot2.py (100%) diff --git a/vodkabot.py b/vodkabot2.py similarity index 100% rename from vodkabot.py rename to vodkabot2.py From c69e4a928569214558ad67e7cea45e0fe2ff8e65 Mon Sep 17 00:00:00 2001 From: kirwinkk <31506555+kirwinkk@users.noreply.github.com> Date: Fri, 8 Sep 2017 23:28:50 +0800 Subject: [PATCH 3/6] Update vodkabot2.py --- vodkabot2.py | 55 ++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/vodkabot2.py b/vodkabot2.py index ad9a7c2..c02cd91 100644 --- a/vodkabot2.py +++ b/vodkabot2.py @@ -39,7 +39,7 @@ def sendMessage(to, text, contentMetadata={}, contentType=0): def NOTIFIED_ADD_CONTACT(op): try: - sendMessage(op.param1, client.getContact(op.param1).displayName + "謝謝加入") + sendMessage(op.param1, client.getContact(op.param1).displayName + "Hi") except Exception as e: print e print ("\n\nNOTIFIED_ADD_CONTACT\n\n") @@ -60,7 +60,7 @@ def NOTIFIED_ACCEPT_GROUP_INVITATION(op): def NOTIFIED_KICKOUT_FROM_GROUP(op): try: - sendMessage(op.param1, client.getContact(op.param3).displayName + " 被踢了呢><") + 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 + " 戦神跟你說 ByeBye\n(*´・ω・*)") + sendMessage(op.param1, client.getContact(op.param2).displayName + " 退了.....") except Exception as e: print e print ("\n\nNOTIFIED_LEAVE_GROUP\n\n") @@ -141,12 +141,17 @@ 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\n[群組名稱]\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: 許可中\n" + else: md += "\n\n群組URL: 關閉中\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 msg.text == "help": + sendMessage(msg.to, "ㄌㄑandㄎㄩ 專屬help\n[Mid] 查看自己的mid\n[gid] 查看群組gid\n[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n + [url] 取得群組網址\n[urlon] 開啟群組網址\n[urloff] 關閉群組網址\n[kick:] 利用mid踢人\n[Nk:] 利用名字踢人(完整用戶名稱)\n + [cancel] 取消全部邀請\n[invite:] 利用mid邀請\n[show:] 顯示mid得友資\n[set] 設定已讀點\n[read] 顯示已讀用戶\n + [time] 顯示現在時間\n[gift] 發送禮物\n\n\n\n[" + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + "]") if "gname:" in msg.text: key = msg.text[22:] group = client.getGroup(msg.to) @@ -155,54 +160,54 @@ 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, "網址早就開了") else: group.preventJoinByTicket = False client.updateGroup(group) - 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, "網址早就關了") 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, "ㄌㄑandㄎㄩ 跟你說掰掰~") client.kickoutFromGroup(msg.to, [""+Mids[kazu]+""]) contact = client.getContact(Mids[kazu]) - sendMessage(msg.to, ""+contact.displayName+" Sorry") + sendMessage(msg.to, ""+contact.displayName+" 被我踢了 嘿嘿") else: sendMessage(msg.to, "wtf?") if msg.text == "cancel": group = client.getGroup(msg.to) if group.invitee is None: - sendMessage(op.message.to, "沒有邀請昂><") + 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)) + "人 已被戦神取消") + sendMessage(msg.to, str(len(group.invitee)) + "人已被ㄌㄑ取消~") if "invite:" in msg.text: key = msg.text[-33:] client.findAndAddContactsByMid(key) client.inviteIntoGroup(msg.to, [key]) contact = client.getContact(key) - sendMessage(msg.to, ""+contact.displayName+" I invited you") + sendMessage(msg.to, ""+contact.displayName+" 已經被ㄌㄑ邀請了~") if msg.text == "me": M = Message() M.to = msg.to @@ -213,13 +218,13 @@ def SEND_MESSAGE(op): key = msg.text[-33:] sendMessage(msg.to, text=None, contentMetadata={'mid': key}, contentType=13) contact = client.getContact(key) - sendMessage(msg.to, ""+contact.displayName+"'s contact") + sendMessage(msg.to, ""+contact.displayName+"的友資~") if msg.text == "time": 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 成功") + sendMessage(msg.to, "ㄌㄑ已設定已讀點~") try: del wait['readPoint'][msg.to] del wait['readMember'][msg.to] @@ -240,9 +245,9 @@ def SEND_MESSAGE(op): print rom chiya += rom[1] + "\n" - 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, "ㄌㄑ來抓已讀囉~\n\n已讀的人有:\n %s\n><\n\n已讀不回的人有:\n%s ♪\n\n已讀點設定時間:\n[%s]" % (wait['readMember'][msg.to],chiya,setTime[msg.to])) else: - sendMessage(msg.to, "請先set") + sendMessage(msg.to, "笨ㄌㄑ還沒設已讀點拉><") else: pass else: From 5d47fa0421c7fbe49bd4c239c1d464bb8e4f8fad Mon Sep 17 00:00:00 2001 From: kirwinkk <31506555+kirwinkk@users.noreply.github.com> Date: Fri, 8 Sep 2017 23:33:10 +0800 Subject: [PATCH 4/6] Update vodkabot2.py --- vodkabot2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vodkabot2.py b/vodkabot2.py index c02cd91..b431345 100644 --- a/vodkabot2.py +++ b/vodkabot2.py @@ -148,7 +148,7 @@ def SEND_MESSAGE(op): else: md += "\n成員人數: " + str(len(group.members)) + "人\n招待中人數: " + str(len(group.invitee)) + "人" sendMessage(msg.to,md) if msg.text == "help": - sendMessage(msg.to, "ㄌㄑandㄎㄩ 專屬help\n[Mid] 查看自己的mid\n[gid] 查看群組gid\n[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n + sendMessage(msg.to,"ㄌㄑandㄎㄩ 專屬help\n[Mid] 查看自己的mid\n[gid] 查看群組gid\n[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n [url] 取得群組網址\n[urlon] 開啟群組網址\n[urloff] 關閉群組網址\n[kick:] 利用mid踢人\n[Nk:] 利用名字踢人(完整用戶名稱)\n [cancel] 取消全部邀請\n[invite:] 利用mid邀請\n[show:] 顯示mid得友資\n[set] 設定已讀點\n[read] 顯示已讀用戶\n [time] 顯示現在時間\n[gift] 發送禮物\n\n\n\n[" + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + "]") From ea51eb95ec3e1773fc616424de1ebec3a3437b9f Mon Sep 17 00:00:00 2001 From: kirwinkk <31506555+kirwinkk@users.noreply.github.com> Date: Fri, 8 Sep 2017 23:39:12 +0800 Subject: [PATCH 5/6] Update vodkabot2.py --- vodkabot2.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vodkabot2.py b/vodkabot2.py index b431345..75b8094 100644 --- a/vodkabot2.py +++ b/vodkabot2.py @@ -148,10 +148,8 @@ def SEND_MESSAGE(op): else: md += "\n成員人數: " + str(len(group.members)) + "人\n招待中人數: " + str(len(group.invitee)) + "人" sendMessage(msg.to,md) if msg.text == "help": - sendMessage(msg.to,"ㄌㄑandㄎㄩ 專屬help\n[Mid] 查看自己的mid\n[gid] 查看群組gid\n[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n - [url] 取得群組網址\n[urlon] 開啟群組網址\n[urloff] 關閉群組網址\n[kick:] 利用mid踢人\n[Nk:] 利用名字踢人(完整用戶名稱)\n - [cancel] 取消全部邀請\n[invite:] 利用mid邀請\n[show:] 顯示mid得友資\n[set] 設定已讀點\n[read] 顯示已讀用戶\n - [time] 顯示現在時間\n[gift] 發送禮物\n\n\n\n[" + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + "]") + sendMessage(msg.to,"ㄌㄑandㄎㄩ 專屬help\n[Mid] 查看自己的mid\n" + "[gid] 查看群組gid\n" + "[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n" + "[url] 取得群組網址\n[urlon] 開啟群組網址\n[urloff] 關閉群組網址\n[kick:] 利用mid踢人\n" + + "[Nk:] 利用名字踢人(完整用戶名稱)\n" + "[cancel] 取消全部邀請\n[invite:] 利用mid邀請\n[show:] 顯示mid得友資\n[set] 設定已讀點\n[read] 顯示已讀用戶\n[time] 顯示現在時間\n[gift] 發送禮物\n\n\n\n[" + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + "]") if "gname:" in msg.text: key = msg.text[22:] group = client.getGroup(msg.to) From e3363ae4347738814facdb56eb329b2bee304191 Mon Sep 17 00:00:00 2001 From: kirwinkk <31506555+kirwinkk@users.noreply.github.com> Date: Fri, 8 Sep 2017 23:46:43 +0800 Subject: [PATCH 6/6] Update vodkabot2.py --- vodkabot2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vodkabot2.py b/vodkabot2.py index 75b8094..7b97fc3 100644 --- a/vodkabot2.py +++ b/vodkabot2.py @@ -148,7 +148,7 @@ def SEND_MESSAGE(op): else: md += "\n成員人數: " + str(len(group.members)) + "人\n招待中人數: " + str(len(group.invitee)) + "人" sendMessage(msg.to,md) if msg.text == "help": - sendMessage(msg.to,"ㄌㄑandㄎㄩ 專屬help\n[Mid] 查看自己的mid\n" + "[gid] 查看群組gid\n" + "[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n" + "[url] 取得群組網址\n[urlon] 開啟群組網址\n[urloff] 關閉群組網址\n[kick:] 利用mid踢人\n" + + sendMessage(msg.to,"ㄌㄑandㄎㄩ 專屬help\n\n[mid] 查看自己的mid\n" + "[gid] 查看群組gid\n" + "[me︎] 送出自己的友資\n[ginfo] 查看群組詳細資料\n" + "[url] 取得群組網址\n[urlon] 開啟群組網址\n[urloff] 關閉群組網址\n[kick:] 利用mid踢人\n" + "[Nk:] 利用名字踢人(完整用戶名稱)\n" + "[cancel] 取消全部邀請\n[invite:] 利用mid邀請\n[show:] 顯示mid得友資\n[set] 設定已讀點\n[read] 顯示已讀用戶\n[time] 顯示現在時間\n[gift] 發送禮物\n\n\n\n[" + datetime.datetime.today().strftime('%Y年%m月%d日 %H:%M:%S') + "]") if "gname:" in msg.text: key = msg.text[22:] @@ -191,7 +191,7 @@ def SEND_MESSAGE(op): contact = client.getContact(Mids[kazu]) 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: