Skip to content

Commit

Permalink
Update vodkabot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kirwinkk committed Sep 1, 2017
1 parent 95c9c8f commit d2ebcca
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions vodkabot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def sendMessage(to, text, contentMetadata={}, contentType=0):

This comment has been minimized.

Copy link
@azyzal

azyzal Sep 13, 2017

Azyzal

This comment has been minimized.

Copy link
@mwahyu

mwahyu via email Sep 14, 2017

This comment has been minimized.

Copy link
@mwahyu

mwahyu via email Sep 15, 2017

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")
Expand All @@ -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")
Expand All @@ -60,7 +60,7 @@ def NOTIFIED_ACCEPT_GROUP_INVITATION(op):

def NOTIFIED_KICKOUT_FROM_GROUP(op):

This comment has been minimized.

Copy link
@azyzal

azyzal Sep 13, 2017

Bye

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")
Expand All @@ -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")
Expand Down Expand Up @@ -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:]
Expand All @@ -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.

Copy link
@azyzal

azyzal Sep 13, 2017

Hello

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.

Copy link
@azyzal

azyzal Sep 13, 2017

Kickal

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.

Copy link
@azyzal

azyzal Sep 13, 2017

Cepot

client.findAndAddContactsByMid(key)
Expand All @@ -215,11 +215,11 @@ def SEND_MESSAGE(op):
contact = client.getContact(key)
sendMessage(msg.to, ""+contact.displayName+"'s contact")

This comment has been minimized.

Copy link
@azyzal

azyzal Sep 13, 2017

Cepot

This comment has been minimized.

Copy link
@keiko01

keiko01 Oct 30, 2017

RF

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]
Expand All @@ -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 = ""
Expand All @@ -240,9 +240,9 @@ def SEND_MESSAGE(op):
print rom
chiya += rom[1] + "\n"

This comment has been minimized.

Copy link
@azyzal

azyzal Sep 13, 2017

10


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:
Expand Down

1 comment on commit d2ebcca

@azyzal
Copy link

@azyzal azyzal commented on d2ebcca Sep 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello

Please sign in to comment.