text: # -*- coding: utf-8 -*-
  
  import LINETCR
  from LINETCR.lib.curve.ttypes import *
  from datetime import datetime
  from bs4 import BeautifulSoup
  import time, random, sys, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, urllib2, wikipedia,tempfile,glob,shutil,unicodedata,goslate
  from gtts import gTTS
  
  cl = LINETCR.LINE()
  cl.login(token="Eou6pbnNcTA7koIqQaU0.F9kA4xeIfhyY+fFn4Y7tea.pU1duR9y0bds3S1ClK8A/8E4o9YETxeAUdLWG0gkilk=")
  cl.loginResult()
  
  kk = LINETCR.LINE()#Assist1
  kk.login(token="Eo1GfwMBTZMPP6ivCz5d.MoLtL7DqWtwuPW+WGWSodq.UqIgtJIPXBJ8vAFa6VZBjcVD2TG06+5A+m7udhnn16Y=")
  kk.loginResult()
  
  kc = LINETCR.LINE()#Assist2
  kc.login(token="Eo3ooEKUoa86dr2Aq81e.UXlX4s1NJit2Wsbq42X5hG.tUdRIMc9eWXG+RPCBfBv1kRGY/nub/4LsllZaaHhn5w=")
  kk.loginResult()
  print "===[Login Success]==="
  
  reload(sys)
  sys.setdefaultencoding('utf-8')
  
  helpMessage ="""
  ┏━━ೋ• ❄ •ೋ━━━┓
      ❁ ᴀʟғɪᴀɴ sᴇʟғʙᴏᴛ❁    
  ┗━━ೋ• ❄ •ೋ━━━┛
  🛡sᴇᴛᴛɪɴɢ ᴄᴍᴅ🛡
  ✈[Url:on/off]
  ✈[Autojoin:on/off]
  ✈[Autocancel:on/off
  ✈[Qr:on/off]
  ✈[Autokick:on/off]
  ✈[Contact:on/off]
  ✈[Status]
  
  ♻️sᴛᴇᴀʟ ᴄᴍᴅ♻️
  ✈[Steal contact @{name}]
  ✈[Steal mid @{name}]
  ✈[Steal group pict]
  ✈[Steal bio @{name}]
  ✈[Steal cover @{name}]
  ✈[Steal pict @{name}]
  
  ☣️ᴍᴀʀᴋ ᴛᴏ ʟɪsᴛ ᴄᴍᴅ☣️
  ✈[Ban @{name}]
  ✈[Unban @{name}]
  ✈[Ban {send contact}]
  ✈[Unban {send contact}]
  ✈[Banlist]
  ✈[Kick @{name}]
  ✈[Kill ban]
  ✈[Spamcontact @{name}]
  ✈[Copy @{name}]
  ✈[Backup me]
  ✈[Gn: {Text}]
  ✈[Kick: {mid}
  ✈[Invite: {mid}]
  
  ☔ᴄʜᴀᴛ ʀᴇʟᴀᴛᴇᴅ☔
  ✈[Wikipedia {text search}]
  ✈[Music ]
  ✈[.instagram {username}]
  ✈[/say {text}]
  ✈[Vidio {text search}]
  ✈[Creator]
  ✈[Ginfo]
  ✈[Gcreator]
  ✈[Glist]
  ✈[Gurl]
  ✈[Ourl/Curl]
  ✈[Tagall]
  ✈[Gift]
  ✈[Welcome]
  ✈[Speed]
  ✈[Set]
  ✈[Read]
  """
  KAC=[cl]
  mid = cl.getProfile().mid
  Amid = kk.getProfile().mid
  Bmid = kc.getProfile().mid
  Bots=[mid,Amid,Bmid]
  Creator="u7fd29ae17122147632fc57cde32ed310"
  admin=["u7fd29ae17122147632fc57cde32ed310"]
  owner="u7fd29ae17122147632fc57cde32ed310"
  
  contact = cl.getProfile()
  backup = cl.getProfile()
  backup.displayName = contact.displayName
  backup.statusMessage = contact.statusMessage
  backup.pictureStatus = contact.pictureStatus
  
  wait = {
      "LeaveRoom":True,
      "AutoJoin":True,
      "Members":0,
      "AutoCancel":False,
      "AutoKick":False,   
      "message":" " "Terima Kasih Sudah Menambahkan Aku Jadi Teman" " ",
      "blacklist":{},
      "wblacklist":False,
      "dblacklist":False,
      "Qr":True,
      "Timeline":True,
      "Contact":True,
      "lang":"JP",
      "comment":"Thanks for add me",
      "BlGroup":{}
  }
  
  
  def sendMessage(to, text, 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
      
  def yt(query):
      with requests.session() as s:
           isi = []
           if query == "":
               query = "S1B tanysyz"   
           s.headers['user-agent'] = 'Mozilla/5.0'
           url    = 'http://www.youtube.com/results'
           params = {'search_query': query}
           r    = s.get(url, params=params)
           soup = BeautifulSoup(r.content, 'html5lib')
           for a in soup.select('.yt-lockup-title > a[title]'):
              if '&list=' not in a['href']:
                  if 'watch?v' in a['href']:
                      b = a['href'].replace('watch?v=', '')
                      isi += ['youtu.be' + b]
           return isi
  
  def bot(op):
      try:
  #--------------------END_OF_OPERATION--------------------
          if op.type == 0:
              return
  #-------------------NOTIFIED_READ_MESSAGE----------------
          if op.type == 55:
  	    try:
  	      group_id = op.param1
  	      user_id=op.param2
  	      subprocess.Popen('echo "'+ user_id+'|'+str(op.createdTime)+'" >> dataSeen/%s.txt' % group_id, shell=True, stdout=subprocess.PIPE, )
  	    except Exception as e:
  	      print e
  #------------------NOTIFIED_INVITE_INTO_ROOM-------------
          if op.type == 22:
              cl.leaveRoom(op.param1)
  #--------------------INVITE_INTO_ROOM--------------------
          if op.type == 21:
              cl.leaveRoom(op.param1)
  
  #--------------NOTIFIED_INVITE_INTO_GROUP----------------
  
  	    if mid in op.param3:
                  if wait["AutoJoin"] == True:
                      cl.acceptGroupInvitation(op.param1)
                  else:
  		    cl.rejectGroupInvitation(op.param1)
  	    else:
                  if wait["AutoCancel"] == True:
  		    if op.param3 in admin:
  			pass
  		    else:
                          cl.cancelGroupInvitation(op.param1, [op.param3])
  		else:
  		    if op.param3 in wait["blacklist"]:
  			cl.cancelGroupInvitation(op.param1, [op.param3])
  			cl.sendText(op.param1, "Itu kicker jgn di invite!")
  		    else:
  			pass
  #------------------NOTIFIED_KICKOUT_FROM_GROUP-----------------
          if op.type == 19:
  		if wait["AutoKick"] == True:
                      if op.param2 in admin:
                          pass
                      try:
                          cl.kickoutFromGroup(op.param1,[op.param2])
  			cl.inviteIntoGroup(op.param1,[op.param3])
                      except:
                          try:
  			    cl.kickoutFromGroup(op.param1,[op.param2])
  			    cl.inviteIntoGroup(op.param1,[op.param3])
                          except:
                              print ("client Kick regulation or Because it does not exist in the group\ngid=["+op.param1+"]\nmid=["+op.param2+"]")
                          if op.param2 in wait["blacklist"]:
                              pass
                          else:
  			    if op.param2 in admin:
  			        pass
  			    else:
                                  wait["blacklist"][op.param2] = True
                      if op.param2 in wait["blacklist"]:
                          pass
                      else:
  		        if op.param2 in admin:
  			    pass
  		        else:
                              wait["blacklist"][op.param2] = True
  
  
  
  #--------------------------NOTIFIED_UPDATE_GROUP---------------------
          if op.type == 11:
              if wait["Qr"] == True:
  		if op.param2 in admin:
  		    pass
  		else:
                      cl.sendText(msg.to, "Jangan mainan QR ntr ada kicker")
              else:
                  pass
  #--------------------------SEND_MESSAGE---------------------------
          if op.type == 25:
              msg = op.message
  #----------------------------------------------------------------------------
              if msg.contentType == 13:
                  if wait["wblacklist"] == True:
  		    if msg.contentMetadata["mid"] not in admin:
                          if msg.contentMetadata["mid"] in wait["blacklist"]:
                              cl.sendText(msg.to,"already")
                              wait["wblacklist"] = False
                          else:
                              wait["blacklist"][msg.contentMetadata["mid"]] = True
                              wait["wblacklist"] = False
                              cl.sendText(msg.to,"aded")
  		    else:
  			cl.sendText(msg.to,"Admin Detected~")
  			
  
                  elif wait["dblacklist"] == True:
                      if msg.contentMetadata["mid"] in wait["blacklist"]:
                          del wait["blacklist"][msg.contentMetadata["mid"]]
                          cl.sendText(msg.to,"deleted")
                          wait["dblacklist"] = False
  
                      else:
                          wait["dblacklist"] = False
                          cl.sendText(msg.to,"It is not in the black list")
  #--------------------------------------------------------
                  elif wait["Contact"] == True:
                       msg.contentType = 0
                       cl.sendText(msg.to,msg.contentMetadata["mid"])
                       if 'displayName' in msg.contentMetadata:
                           contact = cl.getContact(msg.contentMetadata["mid"])
                           try:
                               cu = cl.channel.getCover(msg.contentMetadata["mid"])
                           except:
                               cu = ""
                           cl.sendText(msg.to,"[displayName]:\n" + msg.contentMetadata["displayName"] + "\n[mid]:\n" + msg.contentMetadata["mid"] + "\n[statusMessage]:\n" + contact.statusMessage + "\n[pictureStatus]:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n[coverURL]:\n" + str(cu))
                       else:
                           contact = cl.getContact(msg.contentMetadata["mid"])
                           try:
                               cu = cl.channel.getCover(msg.contentMetadata["mid"])
                           except:
                               cu = ""
                           cl.sendText(msg.to,"[displayName]:\n" + contact.displayName + "\n[mid]:\n" + msg.contentMetadata["mid"] + "\n[statusMessage]:\n" + contact.statusMessage + "\n[pictureStatus]:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n[coverURL]:\n" + str(cu))
  
  
  #--------------------------------------------------------
              elif msg.text == "Ginfo":
                  if msg.toType == 2:
                      ginfo = cl.getGroup(msg.to)
                      try:
                          gCreator = ginfo.creator.displayName
                      except:
                          gCreator = "Error"
                      if wait["lang"] == "JP":
                          if ginfo.invitee is None:
                              sinvitee = "0"
                          else:
                              sinvitee = str(len(ginfo.invitee))
                          if ginfo.preventJoinByTicket == True:
                              u = "close"
                          else:
                              u = "open"
                          cl.sendText(msg.to,"[Group name]\n" + str(ginfo.name) + "\n\n[Gid]\n" + msg.to + "\n\n[Group creator]\n" + gCreator + "\n\n[Profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus + "\n\nMembers:" + str(len(ginfo.members)) + "members\nPending:" + sinvitee + "people\nURL:" + u + "it is inside")
                      else:
                          cl.sendText(msg.to,"[group name]\n" + str(ginfo.name) + "\n[gid]\n" + msg.to + "\n[group creator]\n" + gCreator + "\n[profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus)
                  else:
                      if wait["lang"] == "JP":
                          cl.sendText(msg.to,"Can not be used outside the group")
                      else:
                          cl.sendText(msg.to,"Not for use less than group")
  
  #--------------------------------------------------------
              elif msg.text is None:
                  return
  #--------------------------------------------------------
              elif msg.text in ["Creator"]:
                  msg.contentType = 13
                  msg.contentMetadata = {'mid': Creator}
                  cl.sendMessage(msg)
  		cl.sendText(msg.to,"Itu creator bot ini")
  #--------------------------------------------------------
  	    elif msg.text in ["Group creator","Gcreator","gcreator"]:
  		ginfo = cl.getGroup(msg.to)
  		gCreator = ginfo.creator.mid
                  msg.contentType = 13
                  msg.contentMetadata = {'mid': gCreator}
                  cl.sendMessage(msg)
  		cl.sendText(msg.to,"Itu Yang Buat Grup Ini")
  #--------------------------------------------------------
              elif msg.contentType == 16:
                  if wait["Timeline"] == True:
                      msg.contentType = 0
                      msg.text = "post URL\n" + msg.contentMetadata["postEndUrl"]
                      cl.sendText(msg.to,msg.text)
  #--------------------------------------------------------
              elif msg.text in ["Key","help","Help"]:
                  cl.sendText(msg.to,helpMessage)
  #--------------------------------------------------------
              elif msg.text in ["List group","Glist","glist"]:
                  gid = cl.getGroupIdsJoined()
                  h = ""
  		jml = 0
                  for i in gid:
  		    gn = cl.getGroup(i).name
                      h += "║❂͜͡➣【%s】\n" % (gn)
  		    jml += 1
                  cl.sendText(msg.to,"======[List Group]======\n"+ h +"Total group: "+str(jml))
  #--------------------------------------------------------
  	    elif "Leave group: " in msg.text:
  		ng = msg.text.replace("Leave group: ","")
  		gid = cl.getGroupIdsJoined()
                  for i in gid:
                      h = cl.getGroup(i).name
  		    if h == ng:
  			cl.sendText(i,"Bye "+h+"~")
  		        cl.leaveGroup(i)
  			cl.sendText(msg.to,"Success left ["+ h +"] group")
  		    else:
  			pass
  #--------------------------------------------------------
  #--------------------------------------------------------
              elif msg.text in ["cancel","Cancel"]:
                  if msg.toType == 2:
                      X = cl.getGroup(msg.to)
                      if X.invitee is not None:
                          gInviMids = [contact.mid for contact in X.invitee]
                          cl.cancelGroupInvitation(msg.to, gInviMids)
                      else:
                          cl.sendText(msg.to,"No one is inviting")
                  else:
                      Cl.sendText(msg.to,"Can not be used outside the group")
  #--------------------------------------------------------
              elif msg.text in ["Ourl","Url:on"]:
                  if msg.toType == 2:
                      X = cl.getGroup(msg.to)
                      X.preventJoinByTicket = False
                      cl.updateGroup(X)
                      cl.sendText(msg.to,"Url Active")
                  else:
                      cl.sendText(msg.to,"Can not be used outside the group")
  #--------------------------------------------------------
              elif msg.text in ["Curl","Url:off"]:
                  if msg.toType == 2:
                      X = cl.getGroup(msg.to)
                      X.preventJoinByTicket = True
                      cl.updateGroup(X)
                      cl.sendText(msg.to,"Url inActive")
  
                  else:
                      cl.sendText(msg.to,"Can not be used outside the group")
  #--------------------------------------------------------
              elif msg.text in ["Join on","Autojoin:on"]:
                  wait["AutoJoin"] = True
                  cl.sendText(msg.to,"AutoJoin Active")
  
              elif msg.text in ["Join off","Autojoin:off"]:
                  wait["AutoJoin"] = False
                  cl.sendText(msg.to,"AutoJoin inActive")
  
  #--------------------------------------------------------
  	    elif msg.text in ["Autocancel:on"]:
                  wait["AutoCancel"] = True
                  cl.sendText(msg.to,"The group of people and below decided to automatically refuse invitation")
  		print wait["AutoCancel"][msg.to]
  
  	    elif msg.text in ["Autocancel:off"]:
                  wait["AutoCancel"] = False
                  cl.sendText(msg.to,"Invitation refused turned off")
  		print wait["AutoCancel"][msg.to]
  #--------------------------------------------------------
  	    elif "Qr:on" in msg.text:
  	        wait["Qr"] = True
  	    	cl.sendText(msg.to,"QR Protect Active")
  
  	    elif "Qr:off" in msg.text:
  	    	wait["Qr"] = False
  	    	cl.sendText(msg.to,"Qr Protect inActive")
  #--------------------------------------------------------
  	    elif "Autokick:on" in msg.text:
  		wait["AutoKick"] = True
  		cl.sendText(msg.to,"AutoKick Active")
  
  	    elif "Autokick:off" in msg.text:
  		wait["AutoKick"] = False
  		cl.sendText(msg.to,"AutoKick inActive")
  #--------------------------------------------------------
              elif msg.text in ["K on","Contact:on"]:
                  wait["Contact"] = True
                  cl.sendText(msg.to,"Contact Active")
  
              elif msg.text in ["K off","Contact:off"]:
                  wait["Contact"] = False
                  cl.sendText(msg.to,"Contact inActive")
  #--------------------------------------------------------
              elif msg.text in ["Status"]:
                  md = ""
  		if wait["AutoJoin"] == True: md+="✦ Auto join : on\n"
                  else: md +="✦ Auto join : off\n"
  		if wait["Contact"] == True: md+="✦ Info Contact : on\n"
  		else: md+="✦ Info Contact : off\n"
                  if wait["AutoCancel"] == True:md+="✦ Auto cancel : on\n"
                  else: md+= "✦ Auto cancel : off\n"
  		if wait["Qr"] == True: md+="✦ Qr Protect : on\n"
  		else:md+="✦ Qr Protect : off\n"
  		if wait["AutoKick"] == True: md+="✦ Autokick : on\n"
  		else:md+="✦ Autokick : off"
                  cl.sendText(msg.to,"=====[Status]=====\n"+md)
  #--------------------------------------------------------
              elif msg.text in ["Gift","gift"]:
                  msg.contentType = 9
                  msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58',
                                      'PRDTYPE': 'THEME',
                                      'MSGTPL': '5'}
                  msg.text = None
                  cl.sendMessage(msg)
  
  
              elif msg.text in ["Gift1"]:
                  msg.contentType = 9
                  msg.contentMetadata={'PRDID': '696d7046-843b-4ed0-8aac-3113ed6c0733',
                                      'PRDTYPE': 'THEME',
                                      'MSGTPL': '6'}
                  msg.text = None
                  cl.sendMessage(msg)
  
              elif msg.text in ["Gift2"]:
                  msg.contentType = 9
                  msg.contentMetadata={'PRDID': '8fe8cdab-96f3-4f84-95f1-6d731f0e273e',
                                      'PRDTYPE': 'THEME',
                                      'MSGTPL': '7'}
                  msg.text = None
                  cl.sendMessage(msg)
  
              elif msg.text in ["Gift3"]:
                  msg.contentType = 9
                  msg.contentMetadata={'PRDID': 'ae3d9165-fab2-4e70-859b-c14a9d4137c4',
                                      'PRDTYPE': 'THEME',
                                      'MSGTPL': '8'}
                  msg.text = None
                  cl.sendMessage(msg)
  
  #--------------------------------------------------------
              elif msg.text in ["Tag all","tagall","Tagall","Tag All"]:
                if msg.from_ in admin:
                  group = cl.getGroup(msg.to)
                  nama = [contact.mid for contact in group.members]
                  cb = ""
                  cb2 = "" 
                  strt = int(0)
                  akh = int(0)
                  for md in nama:
                      akh = akh + int(6)
                      cb += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(md)+"},"""
                      strt = strt + int(7)
                      akh = akh + 1
                      cb2 += "@nrik \n"
                  cb = (cb[:int(len(cb)-1)])
                  msg.contentType = 0
                  msg.text = cb2
                  msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+cb+']}','EMTVER':'4'}
                  try:
                      ki.sendMessage(msg)
                  except Exception as error:
                      print error
  
              elif "Rename:" in msg.text:
                if msg.from_ in owner:
                  string = msg.text.replace("Rename:","")
                  if len(string.decode('utf-8')) <= 99999999999999999999999999999999999999999:
                      profile = cl.getProfile()
                      profile.displayName = string
                      cl.updateProfile(profile)
                      
              elif "Mid @" in msg.text:
                  _name = msg.text.replace("Mid @","")
                  _nametarget = _name.rstrip(' ')
                  gs = cl.getGroup(msg.to)
                  for g in gs.members:
                      if _nametarget == g.displayName:
                          cl.sendText(msg.to, g.mid)
                      else:
                          cl.sendText(msg.to,"Error.")
                          
              elif "Spamcontact @" in msg.text:
                  _name = msg.text.replace("Spamcontact @","")
                  _nametarget = _name.rstrip(' ')
                  gs = cl.getGroup(msg.to)
                  for g in gs.members:
                      if _nametarget == g.displayName:
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam") 
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(g.mid,"Spam")
                         cl.sendText(msg.to, "Done")
                         print " Spammed !"
                         
  
  #--------------------------CEK SIDER------------------------------
  
              elif "Set" in msg.text:
                  subprocess.Popen("echo '' > dataSeen/"+msg.to+".txt", shell=True, stdout=subprocess.PIPE)
                  cl.sendText(msg.to, "Checkpoint checked!")
                  print "@setview"
  
              elif "Read" in msg.text:
  	        lurkGroup = ""
  	        dataResult, timeSeen, contacts, userList, timelist, recheckData = [], [], [], [], [], []
                  with open('dataSeen/'+msg.to+'.txt','r') as rr:
                      contactArr = rr.readlines()
                      for v in xrange(len(contactArr) -1,0,-1):
                          num = re.sub(r'\n', "", contactArr[v])
                          contacts.append(num)
                          pass
                      contacts = list(set(contacts))
                      for z in range(len(contacts)):
                          arg = contacts[z].split('|')
                          userList.append(arg[0])
                          timelist.append(arg[1])
                      uL = list(set(userList))
                      for ll in range(len(uL)):
                          try:
                              getIndexUser = userList.index(uL[ll])
                              timeSeen.append(time.strftime("%H:%M:%S", time.localtime(int(timelist[getIndexUser]) / 1000)))
                              recheckData.append(userList[getIndexUser])
                          except IndexError:
                              conName.append('nones')
                              pass
                      contactId = cl.getContacts(recheckData)
                      for v in range(len(recheckData)):
                          dataResult.append(contactId[v].displayName + ' ('+timeSeen[v]+')')
                          pass
                      if len(dataResult) > 0:
                          tukang = "++++TERCIDUK++++\n*"
                          grp = '\n* '.join(str(f) for f in dataResult)
                          total = '\n\nTotal %i viewers (%s)' % (len(dataResult), datetime.now().strftime('%H:%M:%S') )
                          cl.sendText(msg.to, "%s %s %s" % (tukang, grp, total))
                      else:
                          cl.sendText(msg.to, "Belum ada viewers")
                      print "@viewseen"
  #--------------------------------------------------------
  
  #KICK_BY_TAG
  	    elif "Kick " in msg.text:
  		if 'MENTION' in msg.contentMetadata.keys()!= None:
  		    names = re.findall(r'@(\w+)', msg.text)
  		    mention = ast.literal_eval(msg.contentMetadata['MENTION'])
  		    mentionees = mention['MENTIONEES']
  		    print mentionees
  		    for mention in mentionees:
  			kk.kickoutFromGroup(msg.to,[mention['M']])
  
  #--------------------------------------------------------
  	    elif "Add all" in msg.text:
  		thisgroup = cl.getGroups([msg.to])
  		Mids = [contact.mid for contact in thisgroup[0].members]
  		mi_d = Mids[:33]
  		cl.findAndAddContactsByMids(mi_d)
  		cl.sendText(msg.to,"Success Add all")
  #--------------------------------------------------------
  	    elif "Recover" in msg.text:
  		thisgroup = cl.getGroups([msg.to])
  		Mids = [contact.mid for contact in thisgroup[0].members]
  		mi_d = Mids[:33]
  		cl.createGroup("Recover", mi_d)
  		cl.sendText(msg.to,"Success recover")
  #--------------------------------------------------------
  	    elif msg.text in ["Remove all chat"]:
  		cl.removeAllMessages(op.param2)
  		cl.sendText(msg.to,"Removed all chat")
  #--------------------------------------------------------
              elif ("Gn: " in msg.text):
                  if msg.toType == 2:
                      X = cl.getGroup(msg.to)
                      X.name = msg.text.replace("Gn: ","")
                      cl.updateGroup(X)
                  else:
                      cl.sendText(msg.to,"It can't be used besides the group.")
  #--------------------------------------------------------
              elif "Kick: " in msg.text:
                  midd = msg.text.replace("Kick: ","")
  		if midd not in admin:
  		    kc.kickoutFromGroup(msg.to,[midd])
  		else:
  		    cl.sendText(msg.to,"Admin Detected")
  #--------------------------------------------------------
              elif "Invite: " in msg.text:
                  midd = msg.text.replace("Invite: ","")
                  kk.findAndAddContactsByMid(midd)
                  kk.inviteIntoGroup(msg.to,[midd])
  #--------------------------------------------------------
              elif msg.text in ["#welcome","Welcome","welcome","Welkam","welkam"]:
                  gs = cl.getGroup(msg.to)
                  cl.sendText(msg.to,"Selamat datang di "+ gs.name)
  #--------------------------------------------------------
  	    elif "Bc: " in msg.text:
  		bc = msg.text.replace("Bc: ","")
  		gid = cl.getGroupIdsJoined()
  		for i in gid:
  		    cl.sendText(i,"[BROADCAST]\n"+bc+"\n#SorryBroadcast")
  		cl.sendText(msg.to,"Success BC BosQ")
  #--------------------------------------------------------
              elif msg.text in ["Cancelall"]:
                  gid = cl.getGroupIdsInvited()
                  for i in gid:
                      kk.rejectGroupInvitation(i)
                  cl.sendText(msg.to,"All invitations have been refused")
  #--------------------------------------------------------
              elif msg.text in ["Gurl"]:
                  if msg.toType == 2:
                      x = cl.getGroup(msg.to)
                      if x.preventJoinByTicket == True:
                          x.preventJoinByTicket = False
                          cl.updateGroup(x)
                      gurl = cl.reissueGroupTicket(msg.to)
                      cl.sendText(msg.to,"line://ti/g/" + gurl)
                  else:
                      if wait["lang"] == "JP":
                          cl.sendText(msg.to,"Can't be used outside the group")
                      else:
                          cl.sendText(msg.to,"Not for use less than group")
  #--------------------------------------------------------
  	    elif msg.text in ["Self Like","Self like"]:
  		try:
  		    print "activity"
  		    url = cl.activity(limit=1)
  		    print url
  		    cl.like(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], likeType=1001)
  		    cl.comment(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], "Auto Liked By AlfianBisma\nSupported By Alfian")
  		    cl.sendText(msg.to, "Success~")
  		except Exception as E:
  		    try:
  			cl.sendText(msg.to,str(E))
  		    except:
  			pass
  
  #--------------------------------------------------------
         #-------------Fungsi Speedbot Start---------------------#
              elif msg.text in ["Speed","Sp"]:
                if msg.from_ in owner:
                  start = time.time()
                  cl.sendText(msg.to, "Wait...")
                  elapsed_time = time.time() - start
                  cl.sendText(msg.to, "%sDetik" % (elapsed_time))
        #-------------Fungsi Speedbot Finish---------------------#
  
  #--------------------------------------------------------
              elif msg.text in ["Ban"]:
                  wait["wblacklist"] = True
                  cl.sendText(msg.to,"send contact")
  
              elif msg.text in ["Unban"]:
                  wait["dblacklist"] = True
                  cl.sendText(msg.to,"send contact")
  #--------------------------------------------------------
  	    elif "Backup me" in msg.text:
  		try:
  		    cl.updateDisplayPicture(profile.pictureStatus)
  		    cl.updateProfile(profile)
  		    cl.sendText(msg.to, "Berhasil Seperti Semula")
  		except Exception as e:
  		    cl.sendText(msg.to, str(e))
  #--------------------------------------------------------
  	    elif "Copy " in msg.text:
                  copy0 = msg.text.replace("Copy ","")
                  copy1 = copy0.lstrip()
                  copy2 = copy1.replace("@","")
                  copy3 = copy2.rstrip()
                  _name = copy3
  		group = cl.getGroup(msg.to)
  		for contact in group.members:
  		    cname = cl.getContact(contact.mid).displayName
  		    if cname == _name:
  			cl.CloneContactProfile(contact.mid)
  			cl.sendText(msg.to, "Berhasil Menjelma")
  		    else:
  			pass
  		
  #--------------------------------------------------------
              elif "Ban @" in msg.text:
                  if msg.toType == 2:
                      print "@Ban by mention"
                      _name = msg.text.replace("Ban @","")
                      _nametarget = _name.rstrip('  ')
                      gs = cl.getGroup(msg.to)
                      gs = kk.getGroup(msg.to)
                      gs = kc.getGroup(msg.to)
                      targets = []
                      for g in gs.members:
                          if _nametarget == g.displayName:
                              targets.append(g.mid)
                      if targets == []:
                          cl.sendText(msg.to,"Not found")
                      else:
                          for target in targets:
  			    if target not in admin:
                                  try:
                                      wait["blacklist"][target] = True
                                      f=codecs.open('st2__b.json','w','utf-8')
                                      json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False)
                                      cl.sendText(msg.to,"Succes BosQ")
                                  except:
                                      cl.sendText(msg.to,"Error")
  			    else:
  				cl.sendText(msg.to,"Admin Detected~")
              elif 'wikipedia ' in msg.text.lower():
                    try:
                        wiki = msg.text.lower().replace("wikipedia ","")
                        wikipedia.set_lang("id")
                        pesan="Title ("
                        pesan+=wikipedia.page(wiki).title
                        pesan+=")\n\n"
                        pesan+=wikipedia.summary(wiki, sentences=1)
                        pesan+="\n"
                        pesan+=wikipedia.page(wiki).url
                        cl.sendText(msg.to, pesan)
                    except:
                            try:
                                pesan="Over Text Limit! Please Click link\n"
                                pesan+=wikipedia.page(wiki).url
                                cl.sendText(msg.to, pesan)
                            except Exception as e:
                                cl.sendText(msg.to, str(e))
              elif '.instagram ' in msg.text.lower():
                  try:
                      instagram = msg.text.lower().replace(".instagram ","")
                      html = requests.get('https://www.instagram.com/' + instagram + '/?')
                      soup = BeautifulSoup(html.text, 'html5lib')
                      data = soup.find_all('meta', attrs={'property':'og:description'})
                      text = data[0].get('content').split()
                      data1 = soup.find_all('meta', attrs={'property':'og:image'})
                      text1 = data1[0].get('content').split()
                      user = "Name: " + text[-2] + "\n"
                      user1 = "Username: " + text[-1] + "\n"
                      followers = "Followers: " + text[0] + "\n"
                      following = "Following: " + text[2] + "\n"
                      post = "Post: " + text[4] + "\n"
                      link = "Link: " + "https://www.instagram.com/" + instagram
                      detail = "========INSTAGRAM INFO USER========\n"
                      details = "\n========INSTAGRAM INFO USER========"
                      cl.sendText(msg.to, detail + user + user1 + followers + following + post + link + details)
                      cl.sendImageWithURL(msg.to, text1[0])
                  except Exception as njer:
                  	cl.sendText(msg.to, str(njer))
              elif 'music ' in msg.text.lower():
                  try:
                      songname = msg.text.lower().replace('music ','')
                      params = {'songname': songname}
                      r = requests.get('http://ide.fdlrcn.com/workspace/yumi-apis/joox?' + urllib.urlencode(params))
                      data = r.text
                      data = json.loads(data)
                      for song in data:
                          hasil = 'This is Your Music\n'
                          hasil += 'Judul : ' + song[0]
                          hasil += '\nDurasi : ' + song[1]
                          hasil += '\nLink Download : ' + song[4]
                          cl.sendText(msg.to, hasil)
                          cl.sendText(msg.to, "Please Wait for audio...")
                          cl.sendAudioWithURL(msg.to, song[4])
  		except Exception as njer:
  		        cl.sendText(msg.to, str(njer))
  #-----------------------------------------------
              elif "/say " in msg.text:
                   psn = msg.text.replace("/say ","")
                   tts = gTTS(psn, lang='id', slow=False)
                   tts.save('tts.mp3')
                   cl.sendAudio(msg.to, 'tts.mp3')
              elif 'Vidio ' in msg.text:
  	      if msg.from_ in admin:
                  try:
                      textToSearch = (msg.text).replace('Vidio ', "").strip()
                      query = urllib.quote(textToSearch)
                      url = "https://www.youtube.com/results?search_query=" + query
                      response = urllib2.urlopen(url)
                      html = response.read()
                      soup = BeautifulSoup(html, "html.parser")
                      results = soup.find(attrs={'class':'yt-uix-tile-link'})
                      ght=('https://www.youtube.com' + results['href'])
  		    cl.sendVideoWithURL(msg.to,ght)
                  except:
                      cl.sendText(msg.to,"Could not find it")
  #--------------------------------------------------------
              elif msg.text in ["Banlist"]:
                  if wait["blacklist"] == {}:
                      cl.sendText(msg.to,"nothing")
                  else:
                      mc = ""
                      for mi_d in wait["blacklist"]:
                          mc += "->" +cl.getContact(mi_d).displayName + "\n"
                      cl.sendText(msg.to,"===[Blacklist User]===\n"+mc)
              elif "Steal bio" in msg.text:
                if msg.from_ in admin:
                  key = eval(msg.contentMetadata["MENTION"])
                  key1 = key["MENTIONEES"][0]["M"]
                  contact = cl.getContact(key1)
                  cu = cl.channel.getCover(key1)
                  try:
                      cl.sendText(msg.to,contact.statusMessage)
                  except:
                      cl.sendText(msg.to,contact.statusMessage)
              elif "Steal cover @" in msg.text:
                if msg.from_ in admin:            
                  print "[Command]dp executing"
                  _name = msg.text.replace("Steal cover @","")
                  _nametarget = _name.rstrip('  ')
                  gs = cl.getGroup(msg.to)
                  targets = []
                  for g in gs.members:
                      if _nametarget == g.displayName:
                          targets.append(g.mid)
                  if targets == []:
                      cl.sendText(msg.to,"Contact not found")
                  else:
                      for target in targets:
                          try:
                              contact = cl.getContact(target)
                              cu = cl.channel.getCover(target)
                              path = str(cu)
                              cl.sendImageWithURL(msg.to, path)
                          except:
                              pass
                  print "[Command]dp executed"
              elif "Steal pict " in msg.text:
                if msg.from_ in admin:
                  if msg.toType == 2:
                      msg.contentType = 0
                      steal0 = msg.text.replace("Steal pict ","")
                      steal1 = steal0.lstrip()
                      steal2 = steal1.replace("@","")
                      steal3 = steal2.rstrip()
                      _name = steal3
                      group = cl.getGroup(msg.to)
                      targets = []
                      for g in group.members:
                          if _name == g.displayName:
                              targets.append(g.mid)
                      if targets == []:
                          cl.sendText(msg.to,"not found")
                      else:
                          for target in targets:
                              try:
                                  contact = cl.getContact(target)
                                  try:
                                      image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus
                                  except:
                                      image = "https://www.1and1.co.uk/digitalguide/fileadmin/DigitalGuide/Teaser/not-found-t.jpg"
                                  try:
                                      cl.sendImageWithURL(msg.to,image)
                                  except Exception as error:
                                      cl.sendText(msg.to,(error))
                                      pass
                              except:
                                  cl.sendText(msg.to,"Error!")
                                  break
                  else:
                      cl.sendText(msg.to,"Tidak bisa dilakukan di luar grup")
              elif "Steal mid" in msg.text:
                if msg.from_ in admin:
                  key = eval(msg.contentMetadata["MENTION"])
                  key1 = key["MENTIONEES"][0]["M"]
                  cl.sendText(msg.to,"Mc: " + key1)
              elif "Steal contact" in msg.text:
                if msg.from_ in admin:
                  key = eval(msg.contentMetadata["MENTION"])
                  key1 = key["MENTIONEES"][0]["M"]                
                  mmid = cl.getContact(key1)
                  msg.contentType = 13
                  msg.contentMetadata = {"mid": key1}
                  cl.sendMessage(msg)
              elif "Steal group pict" in msg.text:
                if msg.from_ in admin:
  					group = cl.getGroup(msg.to)
  					path = "http://dl.profile.line-cdn.net/" + group.pictureStatus
                                          cl.sendImageWithURL(msg.to,path)
  #--------------------------------------------------------
              elif "Unban @" in msg.text:
                  if msg.toType == 2:
                      print "@Unban by mention"
                      _name = msg.text.replace("Unban @","")
                      _nametarget = _name.rstrip('  ')
                      gs = cl.getGroup(msg.to)
                      gs = kk.getGroup(msg.to)
                      gs = kc.getGroup(msg.to)
                      targets = []
                      for g in gs.members:
                          if _nametarget == g.displayName:
                              targets.append(g.mid)
                      if targets == []:
                          cl.sendText(msg.to,"Not found")
                      else:
                          for target in targets:
                              try:
                                  del wait["blacklist"][target]
                                  f=codecs.open('st2__b.json','w','utf-8')
                                  json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False)
                                  cl.sendText(msg.to,"Succes BosQ")
                              except:
                                  cl.sendText(msg.to,"Succes BosQ")
              elif msg.text in ["Masuk","Join all","join all","Join All","join All","Kuy"]: #Panggil Semua Bot
                if msg.from_ in admin:
                  G = cl.getGroup(msg.to)
                  ginfo = cl.getGroup(msg.to)
                  G.preventJoinByTicket = False
                  cl.updateGroup(G)
                  invsend = 0
                  Ticket = cl.reissueGroupTicket(msg.to)
                  kk.acceptGroupInvitationByTicket(msg.to,Ticket)
                  time.sleep(0.01)
                  kc.acceptGroupInvitationByTicket(msg.to,Ticket)
                  time.sleep(0.01)
                  G = cl.getGroup(msg.to)
                  ginfo = cl.getGroup(msg.to)
                  G.preventJoinByTicket = True
                  cl.updateGroup(G)
                  print "Semua Sudah Lengkap"
              elif "Admin add @" in msg.text:
                  if msg.from_ in owner:
                      print "[Command]Staff add executing"
                      _name = msg.text.replace("Admin add @","")
                      _nametarget = _name.rstrip('  ')
                      gs = cl.getGroup(msg.to)
                      gs = kk.getGroup(msg.to)
                      gs = kc.getGroup(msg.to)
                      targets = []
                      for g in gs.members:
                          if _nametarget == g.displayName:
                              targets.append(g.mid)
                      if targets == []:
                          ki.sendText(msg.to,"Contact not found")
                      else:
                          for target in targets:
                              try:
                                  admin.append(target)
                                  cl.sendText(msg.to,"Admin Ditambahkan")
                              except:
                                  pass
                      print "[Command]Admin add executed"
                  else:
                      cl.sendText(msg.to,"Command DiTolak")
                      cl.sendText(msg.to,"Admin Tidak Bisa Menggunakan")
  
              elif "Admin remove @" in msg.text:
                  if msg.from_ in owner:
                      print "[Command]Staff remove executing"
                      _name = msg.text.replace("Admin remove @","")
                      _nametarget = _name.rstrip('  ')
                      gs = cl.getGroup(msg.to)
                      gs = kk.getGroup(msg.to)
                      gs = kc.getGroup(msg.to)
                      targets = []
                      for g in gs.members:
                          if _nametarget == g.displayName:
                              targets.append(g.mid)
                      if targets == []:
                          ki.sendText(msg.to,"Contact not found")
                      else:
                          for target in targets:
                              try:
                                  admin.remove(target)
                                  cl.sendText(msg.to,"Admin Dihapus")
                              except:
                                  pass
                      print "[Command]Admin remove executed"
                  else:
                      cl.sendText(msg.to,"Command DiTolak")
                      cl.sendText(msg.to,"Admin Tidak Bisa Menggunakan")
  
              elif msg.text in ["Adminlist","adminlist"]:
                if msg.from_ in owner:
                  if admin == []:
                      cl.sendText(msg.to,"The adminlist is empty")
                  else:
                      cl.sendText(msg.to,"Tunggu...")
                      mc = ""
                      for mi_d in admin:
                          mc += "❂͜͡➣ " +cl.getContact(mi_d).displayName + "\n"
                      cl.sendText(msg.to,mc)
                      print "[Command]Adminlist executed"
  #--------------------------------------------------------
              elif msg.text in ["Kill ban"]:
                  if msg.toType == 2:
                      group = cl.getGroup(msg.to)
                      gMembMids = [contact.mid for contact in group.members]
                      matched_list = []
                      for tag in wait["blacklist"]:
                          matched_list+=filter(lambda str: str == tag, gMembMids)
                      if matched_list == []:
                          cl.sendText(msg.to,"There was no blacklist user")
                          return
                      for jj in matched_list:
                          cl.kickoutFromGroup(msg.to,[jj])
                      cl.sendText(msg.to,"Blacklist emang pantas tuk di usir")
  #--------------------------------------------------------
  			 
  #--------------------------------------------------------
  #Restart_Program
  	    elif msg.text in ["Bot:restart","Restart","restart","Bot restart","Bot Restart"]:
  		cl.sendText(msg.to, "Bot has been restarted")
  		restart_program()
  		print "@Restart"
              elif "Shutdown" in msg.text:
                 if msg.from_ in owner:
                   try:
                       import sys
                       sys.exit()
                   except:
                       pass
  #--------------------------------------------------------
  
  
  
          if op.type == 59:
              print op
  
  
      except Exception as error:
          print error
  
  
  #thread2 = threading.Thread(target=nameUpdate)
  #thread2.daemon = True
  #thread2.start()
  
  while True:
      try:
          Ops = cl.fetchOps(cl.Poll.rev, 5)
      except EOFError:
          raise Exception("It might be wrong revision\n" + str(cl.Poll.rev))
  
      for Op in Ops:
          if (Op.type != OpType.END_OF_OPERATION):
              cl.Poll.rev = max(cl.Poll.rev, Op.revision)
              bot(Op)
  
  