Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions chivasbot.py → tcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,31 @@ def bot(op):
kc.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif msg.text in ["Tg","Tag all"]:
group = cl.getGroup(msg.to)
jw = [contact.mid for contact in group.members]
cb = ""
cb2 = ""
strt = int(0)
akh = int(0)
for rs in jw:
xname = cl.getContact(rs).displayName
xlen = int(len('x')+1)
akh = akh + xlen
cb += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(rs)+"},"""
strt = strt + int(len('x')+3)
akh = akh + 2
cb2 += "@x \n"
cb = (cb[:int(len(cb)-1)])
msg.contentType = 0
msg.text = cb2
msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+cb+']}','EMTVER':'d'}
try:
cl.sendMessage(msg)
except Exception as error:
print error

#-----------------------------------------------
elif msg.text in ["Kill"]:
if msg.toType == 2:
Expand Down