Commit 39cc8e13e9309badff37be67f86dbeb293ff818e

Authored by Nadya Sutjiadi
Committed by GitHub
1 parent dbd01074

Add files via upload

Showing 1 changed file with 3475 additions and 0 deletions
Chuckysb.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +#Chucky_Bot
  3 +
  4 +import LINETCR
  5 +from LINETCR.lib.curve.ttypes import *
  6 +from datetime import datetime
  7 +from bs4 import BeautifulSoup
  8 +from threading import Thread
  9 +from googletrans import Translator
  10 +from gtts import gTTS
  11 +import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,subprocess,requests,tempfile
  12 +
  13 +nadya = LINETCR.LINE()
  14 +#nadya.login(qr=True)
  15 +nadya.login(token='EpS0tmC0ZTDhKOGiKDmb.fpzoe5O4f6/QVIFsn6/ZAW.l+ZRTs/GX3nkrHE/Y77Huo1aF65/TOARxV8ppihfEOQ=')
  16 +nadya.loginResult()
  17 +print "Nadya-Login Success\n\n=====[Sukses Login]====="
  18 +
  19 +reload(sys)
  20 +sys.setdefaultencoding('utf-8')
  21 +
  22 +
  23 +selfMessage ="""
  24 +╔═════════════════════════
  25 +║ ☆☞ S E L F ☜☆
  26 +╠═════════════════════════
  27 +╠➩〘Hi〙
  28 +╠➩〘Me〙
  29 +╠➩〘Mymid〙
  30 +╠➩〘Mid @〙
  31 +╠➩〘SearchID: (ID LINE)〙
  32 +╠➩〘Checkdate (DD/MM/YY)〙
  33 +╠➩〘Kalender〙
  34 +╠➩〘Steal contact〙
  35 +╠➩〘Pp @〙
  36 +╠➩〘Cover @〙
  37 +╠➩〘Auto like〙
  38 +╠➩〘Scbc Text〙
  39 +╠➩〘Cbc Text〙
  40 +╠➩〘Gbc Text〙
  41 +╠➩〘Getbio @〙
  42 +╠➩〘Getinfo @〙
  43 +╠➩〘Getname @〙
  44 +╠➩〘Getprofile @〙
  45 +╠➩〘Getcontact @〙
  46 +╠➩〘Getvid @〙
  47 +╠➩〘Friendlist〙
  48 +╠➩〘Micadd @〙
  49 +╠➩〘Micdel @〙
  50 +╠➩〘Miclist〙
  51 +╠═════════════════════════
  52 +║ 💠 By : Nadya 💠
  53 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  54 +╚═════════════════════════
  55 +"""
  56 +
  57 +botMessage ="""
  58 +╔═════════════════════════
  59 +║ ☆☞ B O T ☜☆
  60 +╠═════════════════════════
  61 +╠➩〘Absen〙
  62 +╠➩〘Respon〙
  63 +╠➩〘Runtime〙
  64 +╠➩〘Mycopy @〙
  65 +╠➩〘Copycontact〙
  66 +╠➩〘Mybackup〙
  67 +╠➩〘Mybio (Text)〙
  68 +╠➩〘Myname (Text)〙
  69 +╠➩〘@bye〙
  70 +╠➩〘Bot on/off〙
  71 +╠═════════════════════════
  72 +║ 💠 By : Nadya 💠
  73 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  74 +╚═════════════════════════
  75 +"""
  76 +
  77 +mediaMessage ="""
  78 +╔═════════════════════════
  79 +║ ☆☞ M E D I A ☜☆
  80 +╠═════════════════════════
  81 +╠➩〘Gift〙
  82 +╠➩〘Gift1 @ s/d Gift10 @〙
  83 +╠➩〘Giftbycontact〙
  84 +╠➩〘Gif gore〙
  85 +╠➩〘Google: (Text)〙
  86 +╠➩〘Playstore NamaApp〙
  87 +╠➩〘Fancytext: Text〙
  88 +╠➩〘/musik Judul-Penyanyi〙
  89 +╠➩〘/lirik Judul-Penyanyi〙
  90 +╠➩〘/musrik Judul-Penyanyi〙
  91 +╠➩〘/ig UrsnameInstagram〙
  92 +╠➩〘Checkig UrsnameInstagram〙
  93 +╠➩〘/apakah Text (Kerang Ajaib)〙
  94 +╠➩〘/kapan Text (Kerang Ajaib)〙
  95 +╠➩〘/hari Text (Kerang Ajaib)〙
  96 +╠➩〘/berapa Text (Kerang Ajaib)〙
  97 +╠➩〘/berapakah Text〙
  98 +╠➩〘Youtubelink: Judul Video〙
  99 +╠➩〘Youtubevideo: Judul Video〙
  100 +╠➩〘Youtubesearch: Judul Video〙
  101 +╠➩〘Image NamaGambar〙
  102 +╠➩〘Say-id Text〙
  103 +╠➩〘Say-en Text〙
  104 +╠➩〘Say-jp Text〙
  105 +╠➩〘Image NamaGambar〙
  106 +╠➩〘Tr-id Text (Translate En Ke ID〙
  107 +╠➩〘Tr-en Text (Translate ID Ke En〙
  108 +╠➩〘Tr-th Text (Translate ID Ke Th〙
  109 +╠➩〘Id@en Text (Translate ID Ke En〙
  110 +╠➩〘Id@th Text (Translate ID Ke TH〙
  111 +╠➩〘En@id Text (Translate En Ke ID〙
  112 +╠═════════════════════════
  113 +║ 💠 By : Nadya 💠
  114 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  115 +╚═════════════════════════
  116 +"""
  117 +
  118 +groupMessage ="""
  119 +╔═════════════════════════
  120 +║ ☆☞ G R O U P ☜☆
  121 +╠═════════════════════════
  122 +╠➩〘Welcome〙
  123 +╠➩〘Say welcome〙
  124 +╠➩〘Invite creator〙
  125 +╠➩〘Setview〙
  126 +╠➩〘Viewseen〙
  127 +╠➩〘Gn: (NamaGroup)〙
  128 +╠➩〘Tag all〙
  129 +╠➩〘Recover〙
  130 +╠➩〘Cancel〙
  131 +╠➩〘Cancelall〙
  132 +╠➩〘Gcreator〙
  133 +╠➩〘Ginfo〙
  134 +╠➩〘Gurl〙
  135 +╠➩〘List group〙
  136 +╠➩〘Pict group: (NamaGroup)〙
  137 +╠➩〘Spam: (Text)〙
  138 +╠➩〘Add all〙
  139 +╠➩〘Kick: (Mid)〙
  140 +╠➩〘Invite: (Mid)〙
  141 +╠➩〘Invite〙
  142 +╠➩〘Memlist〙
  143 +╠➩〘Getgroup image〙
  144 +╠➩〘Urlgroup Image〙
  145 +╠═════════════════════════
  146 +║ 💠 By : Nadya 💠
  147 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  148 +╚═════════════════════════
  149 +"""
  150 +tjia="u14f64e139a3817afaabe27d237afb36b"
  151 +
  152 +setMessage ="""
  153 +╔═════════════════════════
  154 +║ ☆☞ S E T ☜☆
  155 +╠═════════════════════════
  156 +╠➩〘Sambutan on/off〙
  157 +╠➩〘Mimic on/off〙
  158 +╠➩〘Url on/off〙
  159 +╠➩〘Alwaysread on/off〙
  160 +╠➩〘Sider on/off〙
  161 +╠➩〘Contact on/off〙
  162 +╠➩〘Sticker on〙
  163 +╠➩〘Simisimi on/off〙
  164 +╠═════════════════════════
  165 +║ 💠 By : Nadya 💠
  166 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  167 +╚═════════════════════════
  168 +"""
  169 +
  170 +creatorMessage ="""
  171 +╔═════════════════════════
  172 +║ ☆☞ C R E A T O R ☜☆
  173 +╠═════════════════════════
  174 +╠➩〘Crash〙
  175 +╠➩〘Kickall〙
  176 +╠➩〘Bc: (Text)〙
  177 +╠➩〘Join group: (NamaGroup〙
  178 +╠➩〘Leave group: (NamaGroup〙
  179 +╠➩〘Leave all group〙
  180 +╠➩〘Tag on/off〙
  181 +╠➩〘Bot restart〙
  182 +╠➩〘Turn off〙
  183 +╠═════════════════════════
  184 +║ 💠 By : Nadya 💠
  185 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  186 +╚═════════════════════════
  187 +"""
  188 +
  189 +adminMessage ="""
  190 +╔═════════════════════════
  191 +║ ☆☞ A D M I N ☜☆
  192 +╠═════════════════════════
  193 +╠➩〘Allprotect on/off〙
  194 +╠➩〘Ban〙
  195 +╠➩〘Unban〙
  196 +╠➩〘Ban @〙
  197 +╠➩〘Unban @〙
  198 +╠➩〘Ban list〙
  199 +╠➩〘Clear ban〙
  200 +╠➩〘Kill〙
  201 +╠➩〘Kick @〙
  202 +╠➩〘Set member: (Jumblah)〙
  203 +╠➩〘Ban group: (NamaGroup〙
  204 +╠➩〘Del ban: (NamaGroup〙
  205 +╠➩〘List ban〙
  206 +╠➩〘Kill ban〙
  207 +╠➩〘Glist〙
  208 +╠➩〘Glistmid〙
  209 +╠➩〘Details group: (Gid)〙
  210 +╠➩〘Cancel invite: (Gid)〙
  211 +╠➩〘Invitemeto: (Gid)〙
  212 +╠➩〘Acc invite〙
  213 +╠➩〘Removechat〙
  214 +╠➩〘Qr on/off〙
  215 +╠➩〘Autokick on/off〙
  216 +╠➩〘Autocancel on/off〙
  217 +╠➩〘Invitepro on/off〙
  218 +╠➩〘Join on/off〙
  219 +╠➩〘Joincancel on/off〙
  220 +╠➩〘Respon1 on/off〙
  221 +╠➩〘Respon2 on/off〙
  222 +╠➩〘Respon3 on/off〙
  223 +╠➩〘Responkick on/off〙
  224 +╠═════════════════════════
  225 +║ 💠 By : Nadya 💠
  226 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  227 +╚═════════════════════════
  228 +"""
  229 +
  230 +helpMessage ="""
  231 +╔═════════════════════════
  232 +║ ☆☞ H E L P ☜☆
  233 +╠═════════════════════════
  234 +╠➩〘Help self〙
  235 +╠➩〘Help bot〙
  236 +╠➩〘Help group〙
  237 +╠➩〘Help set〙
  238 +╠➩〘Help media〙
  239 +╠➩〘Help admin〙
  240 +╠➩〘Help creator〙
  241 +╠➩〘Owner〙
  242 +╠➩〘Pap owner〙
  243 +╠➩〘Speed〙
  244 +╠➩〘Speed test〙
  245 +╠➩〘Status〙
  246 +╠═════════════════════════
  247 +║ 💠 By : Nadya 💠
  248 +║ 〽️ line.me/ti/p/~nad_nad. 〽️
  249 +╚═════════════════════════
  250 +"""
  251 +
  252 +
  253 +KAC=[nadya]
  254 +mid = nadya.getProfile().mid
  255 +Bots=[mid]
  256 +Creator=["u14f64e139a3817afaabe27d237afb36b"]
  257 +admin=["u14f64e139a3817afaabe27d237afb36b"]
  258 +
  259 +contact = nadya.getProfile()
  260 +backup1 = nadya.getProfile()
  261 +backup1.displayName = contact.displayName
  262 +backup1.statusMessage = contact.statusMessage
  263 +backup1.pictureStatus = contact.pictureStatus
  264 +
  265 +responsename = nadya.getProfile().displayName
  266 +
  267 +
  268 +wait = {
  269 + "LeaveRoom":True,
  270 + "Bot":True,
  271 + "AutoJoin":False,
  272 + "AutoJoinCancel":False,
  273 + "memberscancel":30,
  274 + "Members":1,
  275 + "AutoCancel":False,
  276 + "AutoKick":False,
  277 + 'pap':{},
  278 + 'invite':{},
  279 + 'steal':{},
  280 + 'gift':{},
  281 + 'copy':{},
  282 + 'likeOn':{},
  283 + 'detectMention':False,
  284 + 'detectMention2':True,
  285 + 'detectMention3':False,
  286 + 'kickMention':False,
  287 + 'sticker':False,
  288 + 'timeline':True,
  289 + "Timeline":True,
  290 + "comment":"Bot Auto Like ©By : Nadya\nContact Me : 👉 line.me/ti/p/~nad_nad.",
  291 + "commentOn":True,
  292 + "commentBlack":{},
  293 + "message":"Thx For Add Me (^_^)\nInvite Me To Your Group ヘ(^_^)ヘ",
  294 + "blacklist":{},
  295 + "wblacklist":False,
  296 + "dblacklist":False,
  297 + "Qr":False,
  298 + "Contact":False,
  299 + "Sambutan":False,
  300 + "inviteprotect":False,
  301 + "alwaysRead":False,
  302 + "Sider":{},
  303 + "Simi":{},
  304 + "lang":"JP",
  305 + "BlGroup":{}
  306 +}
  307 +
  308 +settings = {
  309 + "simiSimi":{}
  310 + }
  311 +
  312 +cctv = {
  313 + "cyduk":{},
  314 + "point":{},
  315 + "sidermem":{}
  316 +}
  317 +
  318 +wait2 = {
  319 + "readPoint":{},
  320 + "readMember":{},
  321 + "setTime":{},
  322 + "ROM":{}
  323 + }
  324 +
  325 +mimic = {
  326 + "copy":False,
  327 + "copy2":False,
  328 + "status":False,
  329 + "target":{}
  330 + }
  331 +
  332 +setTime = {}
  333 +setTime = wait2['setTime']
  334 +mulai = time.time()
  335 +
  336 +def download_page(url):
  337 + version = (3,0)
  338 + cur_version = sys.version_info
  339 + if cur_version >= version:
  340 + import urllib,request
  341 + try:
  342 + headers = {}
  343 + headers['User-Agent'] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  344 + req = urllib,request.Request(url, headers = headers)
  345 + resp = urllib,request.urlopen(req)
  346 + respData = str(resp.read())
  347 + return respData
  348 + except Exception as e:
  349 + print(str(e))
  350 + else:
  351 + import urllib2
  352 + try:
  353 + headers = {}
  354 + headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
  355 + req = urllib2.Request(url, headers = headers)
  356 + response = urllib2.urlopen(req)
  357 + page = response.read()
  358 + return page
  359 + except:
  360 + return"Page Not found"
  361 +
  362 +
  363 +def _images_get_next_item(s):
  364 + start_line = s.find('rg_di')
  365 + if start_line == -1:
  366 + end_quote = 0
  367 + link = "no_links"
  368 + return link, end_quote
  369 + else:
  370 + start_line = s.find('"class="rg_meta"')
  371 + start_content = s.find('"ou"',start_line+90)
  372 + end_content = s.find(',"ow"',start_content-90)
  373 + content_raw = str(s[start_content+6:end_content-1])
  374 + return content_raw, end_content
  375 +
  376 +
  377 +def _images_get_all_items(page):
  378 + items = []
  379 + while True:
  380 + item, end_content = _images_get_next_item(page)
  381 + if item == "no_links":
  382 + break
  383 + else:
  384 + items.append(item)
  385 + time.sleep(0.1)
  386 + page = page[end_content:]
  387 + return items
  388 +
  389 +def waktu(secs):
  390 + mins, secs = divmod(secs,60)
  391 + hours, mins = divmod(mins,60)
  392 + return '%02d Jam %02d Menit %02d Detik' % (hours, mins, secs)
  393 +
  394 +def cms(string, commands): #/XXX, >XXX, ;XXX, ^XXX, %XXX, $XXX...
  395 + tex = ["+","@","/",">",";","^","%","$","^","サテラ:","サテラ:","サテラ:","サテラ:"]
  396 + for texX in tex:
  397 + for command in commands:
  398 + if string ==command:
  399 + return True
  400 + return False
  401 +
  402 +def upload_tempimage(client):
  403 + '''
  404 + Upload a picture of a kitten. We don't ship one, so get creative!
  405 + '''
  406 + config = {
  407 + 'album': album,
  408 + 'name': 'bot auto upload',
  409 + 'title': 'bot auto upload',
  410 + 'description': 'bot auto upload'
  411 + }
  412 +
  413 + print("Uploading image... ")
  414 + image = client.upload_from_path(image_path, config=config, anon=False)
  415 + print("Done")
  416 + print()
  417 +
  418 + return image
  419 +
  420 +def sendAudio(self, to_, path):
  421 + M = Message()
  422 + M.text = None
  423 + M.to = to_
  424 + M.contentMetadata = None
  425 + M.contentPreview = None
  426 + M.contentType = 3
  427 + M_id = self._client.sendMessage(0,M).id
  428 + files = {
  429 + 'file': open(path, 'rb'),
  430 + }
  431 +
  432 +def sendMessage(to, text, contentMetadata={}, contentType=0):
  433 + mes = Message()
  434 + mes.to, mes.from_ = to, profile.mid
  435 + mes.text = text
  436 + mes.contentType, mes.contentMetadata = contentType, contentMetadata
  437 + if to not in messageReq:
  438 + messageReq[to] = -1
  439 + messageReq[to] += 1
  440 +
  441 +def sendImage(self, to_, path):
  442 + M = Message(to=to_, text=None, contentType = 1)
  443 + M.contentMetadata = None
  444 + M.contentPreview = None
  445 + M2 = self._client.sendMessage(0,M)
  446 + M_id = M2.id
  447 + files = {
  448 + 'file': open(path, 'rb'),
  449 + }
  450 + params = {
  451 + 'name': 'media',
  452 + 'oid': M_id,
  453 + 'size': len(open(path, 'rb').read()),
  454 + 'type': 'image',
  455 + 'ver': '1.0',
  456 + }
  457 + data = {
  458 + 'params': json.dumps(params)
  459 + }
  460 + r = self.post_content('https://obs-sg.line-apps.com/talk/m/upload.nhn', data=data, files=files)
  461 + if r.status_code != 201:
  462 + raise Exception('Upload image failure.')
  463 + return True
  464 +
  465 +
  466 +def sendImageWithURL(self, to_, url):
  467 + path = '%s/pythonLine-%i.data' % (tempfile.gettempdir(), randint(0, 9))
  468 + r = requests.get(url, stream=True)
  469 + if r.status_code == 200:
  470 + with open(path, 'w') as f:
  471 + shutil.copyfileobj(r.raw, f)
  472 + else:
  473 + raise Exception('Download image failure.')
  474 + try:
  475 + self.sendImage(to_, path)
  476 + except:
  477 + try:
  478 + self.sendImage(to_, path)
  479 + except Exception as e:
  480 + raise e
  481 +
  482 +def sendAudioWithURL(self, to_, url):
  483 + path = self.downloadFileWithURL(url)
  484 + try:
  485 + self.sendAudio(to_, path)
  486 + except Exception as e:
  487 + raise Exception(e)
  488 +
  489 +def sendAudioWithUrl(self, to_, url):
  490 + path = '%s/pythonLine-%1.data' % (tempfile.gettempdir(), randint(0, 9))
  491 + r = requests.get(url, stream=True, verify=False)
  492 + if r.status_code == 200:
  493 + with open(path, 'w') as f:
  494 + shutil.copyfileobj(r.raw, f)
  495 + else:
  496 + raise Exception('Download audio failure.')
  497 + try:
  498 + self.sendAudio(to_, path)
  499 + except Exception as e:
  500 + raise e
  501 +
  502 +def downloadFileWithURL(self, fileUrl):
  503 + saveAs = '%s/pythonLine-%i.data' % (tempfile.gettempdir(), randint(0, 9))
  504 + r = self.get_content(fileUrl)
  505 + if r.status_code == 200:
  506 + with open(saveAs, 'wb') as f:
  507 + shutil.copyfileobj(r.raw, f)
  508 + return saveAs
  509 + else:
  510 + raise Exception('Download file failure.')
  511 +
  512 +def summon(to, nama):
  513 + aa = ""
  514 + bb = ""
  515 + strt = int(14)
  516 + akh = int(14)
  517 + nm = nama
  518 + for mm in nm:
  519 + akh = akh + 2
  520 + aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},"""
  521 + strt = strt + 6
  522 + akh = akh + 4
  523 + bb += "\xe2\x95\xa0 @x \n"
  524 + aa = (aa[:int(len(aa)-1)])
  525 + msg = Message()
  526 + msg.to = to
  527 + msg.text = "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n"+bb+"\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90"
  528 + msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+aa+']}','EMTVER':'4'}
  529 + print "[Command] Tag All"
  530 + try:
  531 + nadya.sendMessage(msg)
  532 + except Exception as error:
  533 + print error
  534 +
  535 +
  536 +
  537 +def restart_program():
  538 + python = sys.executable
  539 + os.execl(python, python, * sys.argv)
  540 +
  541 +
  542 +def bot(op):
  543 + try:
  544 +
  545 + if op.type == 0:
  546 + return
  547 +
  548 + if op.type == 5:
  549 + if wait["autoAdd"] == True:
  550 + nadya.findAndAddContactsByMid(op.param1)
  551 + if(wait["message"]in[""," ","\n",None]):
  552 + pass
  553 + else:
  554 + nadya.sendText(op.param1,str(wait["message"]))
  555 +
  556 +
  557 + if op.type == 55:
  558 + try:
  559 + group_id = op.param1
  560 + user_id=op.param2
  561 + subprocess.Popen('echo "'+ user_id+'|'+str(op.createdTime)+'" >> dataSeen/%s.txt' % group_id, shell=True, stdout=subprocess.PIPE, )
  562 + except Exception as e:
  563 + print e
  564 +
  565 + if op.type == 55:
  566 + try:
  567 + if cctv['cyduk'][op.param1]==True:
  568 + if op.param1 in cctv['point']:
  569 + Name = nadya.getContact(op.param2).displayName
  570 +# Name = summon(op.param2)
  571 + if Name in cctv['sidermem'][op.param1]:
  572 + pass
  573 + else:
  574 + cctv['sidermem'][op.param1] += "\n• " + Name
  575 + if " " in Name:
  576 + nick = Name.split(' ')
  577 + if len(nick) == 2:
  578 + nadya.sendText(op.param1, "Haii " + "☞ " + Name + " ☜" + "\nNgintip Aja Niih. . .\nChat Kek Idiih (-__-) ")
  579 + time.sleep(0.2)
  580 + summon(op.param1,[op.param2])
  581 + else:
  582 + nadya.sendText(op.param1, "Haii " + "☞ " + Name + " ☜" + "\nBetah Banget Jadi Penonton. . .\nChat Napa (-__-) ")
  583 + time.sleep(0.2)
  584 + summon(op.param1,[op.param2])
  585 + else:
  586 + nadya.sendText(op.param1, "Haii " + "☞ " + Name + " ☜" + "\nNgapain Kak Ngintip Aja???\nSini Gabung Chat... ")
  587 + time.sleep(0.2)
  588 + summon(op.param1,[op.param2])
  589 + else:
  590 + pass
  591 + else:
  592 + pass
  593 + except:
  594 + pass
  595 +
  596 + else:
  597 + pass
  598 +
  599 +
  600 + if op.type == 22:
  601 + nadya.leaveRoom(op.param1)
  602 +
  603 + if op.type == 21:
  604 + nadya.leaveRoom(op.param1)
  605 +
  606 +
  607 + if op.type == 13:
  608 + print op.param3
  609 + if op.param3 in mid:
  610 + if op.param2 in Creator:
  611 + nadya.acceptGroupInvitation(op.param1)
  612 +
  613 +
  614 + if mid in op.param3:
  615 + if wait["AutoJoinCancel"] == True:
  616 + G = nadya.getGroup(op.param1)
  617 + if len(G.members) <= wait["memberscancel"]:
  618 + nadya.acceptGroupInvitation(op.param1)
  619 + nadya.sendText(op.param1,"Maaf " + nadya.getContact(op.param2).displayName + "\nMember Kurang Dari 30 Orang\nUntuk Info, Silahkan Chat Owner Kami!")
  620 + nadya.leaveGroup(op.param1)
  621 + else:
  622 + nadya.acceptGroupInvitation(op.param1)
  623 + nadya.sendText(op.param1,"☆Ketik ☞Help☜ Untuk Bantuan☆\n☆Harap Gunakan Dengan Bijak ^_^ ☆")
  624 +
  625 +
  626 + if mid in op.param3:
  627 + if wait["AutoJoin"] == True:
  628 + G = nadya.getGroup(op.param1)
  629 + if len(G.members) <= wait["Members"]:
  630 + nadya.rejectGroupInvitation(op.param1)
  631 + else:
  632 + nadya.acceptGroupInvitation(op.param1)
  633 + nadya.sendText(op.param1,"☆Ketik ☞Help☜ Untuk Bantuan☆\n☆Harap Gunakan Dengan Bijak ^_^ ☆")
  634 + else:
  635 + if wait["AutoCancel"] == True:
  636 + if op.param3 in Bots:
  637 + pass
  638 + else:
  639 + nadya.cancelGroupInvitation(op.param1, [op.param3])
  640 + else:
  641 + if op.param3 in wait["blacklist"]:
  642 + nadya.cancelGroupInvitation(op.param1, [op.param3])
  643 + nadya.sendText(op.param1, "Blacklist Detected")
  644 + else:
  645 + pass
  646 +
  647 + if op.type == 13:
  648 + if op.param2 not in Creator:
  649 + if op.param2 not in admin:
  650 + if op.param2 not in Bots:
  651 + if op.param2 in Creator:
  652 + if op.param2 in admin:
  653 + if op.param2 in Bots:
  654 + pass
  655 + elif wait["inviteprotect"] == True:
  656 + wait ["blacklist"][op.param2] = True
  657 + nadya.cancelGroupInvitation(op.param1,[op.param3])
  658 + nadya.kickoutFromGroup(op.param1,[op.param2])
  659 + if op.param2 not in Creator:
  660 + if op.param2 not in admin:
  661 + if op.param2 not in Bots:
  662 + if op.param2 in Creator:
  663 + if op.param2 in admin:
  664 + if op.param2 in Bots:
  665 + pass
  666 +
  667 + if op.type == 19:
  668 + if wait["AutoKick"] == True:
  669 + try:
  670 + if op.param3 in Creator:
  671 + if op.param3 in admin:
  672 + if op.param3 in Bots:
  673 + pass
  674 + if op.param2 in Creator:
  675 + if op.param2 in admin:
  676 + if op.param2 in Bots:
  677 + pass
  678 + else:
  679 + nadya.kickoutFromGroup(op.param1,[op.param2])
  680 + if op.param2 in wait["blacklist"]:
  681 + pass
  682 + else:
  683 + nadya.inviteIntoGroup(op.param1,[op.param3])
  684 + except:
  685 + try:
  686 + if op.param2 not in Creator:
  687 + if op.param2 not in admin:
  688 + if op.param2 not in Bots:
  689 + nadya.kickoutFromGroup(op.param1,[op.param2])
  690 + if op.param2 in wait["blacklist"]:
  691 + pass
  692 + else:
  693 + nadya.inviteIntoGroup(op.param1,[op.param3])
  694 + except:
  695 + print ("client Kick regulation or Because it does not exist in the group\ngid=["+op.param1+"]\nmid=["+op.param2+"]")
  696 + if op.param2 in wait["blacklist"]:
  697 + pass
  698 + else:
  699 + if op.param2 in Creator:
  700 + if op.param2 in admin:
  701 + if op.param2 in Bots:
  702 + pass
  703 + else:
  704 + wait["blacklist"][op.param2] = True
  705 + if op.param2 in wait["blacklist"]:
  706 + pass
  707 + else:
  708 + if op.param2 in Creator:
  709 + if op.param2 in admin:
  710 + if op.param2 in Bots:
  711 + pass
  712 + else:
  713 + wait["blacklist"][op.param2] = True
  714 + else:
  715 + pass
  716 +
  717 +
  718 + if mid in op.param3:
  719 + if op.param2 in Creator:
  720 + if op.param2 in Bots:
  721 + pass
  722 + try:
  723 + nadya.kickoutFromGroup(op.param1,[op.param2])
  724 + nadya.kickoutFromGroup(op.param1,[op.param2])
  725 + except:
  726 + try:
  727 + nadya.kickoutFromGroup(op.param1,[op.param2])
  728 + except:
  729 + print ("client Kick regulation or Because it does not exist in the group\ngid=["+op.param1+"]\nmid=["+op.param2+"]")
  730 + if op.param2 in wait["blacklist"]:
  731 + pass
  732 + else:
  733 + if op.param2 in Bots:
  734 + pass
  735 + if op.param2 in wait["blacklist"]:
  736 + pass
  737 + else:
  738 + if op.param2 in Bots:
  739 + pass
  740 + else:
  741 + wait["blacklist"][op.param2] = True
  742 +
  743 +
  744 + if Creator in op.param3:
  745 + if admin in op.param3:
  746 + if op.param2 in Bots:
  747 + pass
  748 + try:
  749 + nadya.kickoutFromGroup(op.param1,[op.param2])
  750 + nadya.kickoutFromGroup(op.param1,[op.param2])
  751 + except:
  752 + try:
  753 + if op.param2 not in Bots:
  754 + nadya.kickoutFromGroup(op.param1,[op.param2])
  755 + if op.param2 in wait["blacklist"]:
  756 + pass
  757 + else:
  758 + nadya.inviteIntoGroup(op.param1,[op.param3])
  759 + except:
  760 + print ("client Kick regulation or Because it does not exist in the group\ngid=["+op.param1+"]\nmid=["+op.param2+"]")
  761 + if op.param2 in wait["blacklist"]:
  762 + pass
  763 + if op.param2 in wait["whitelist"]:
  764 + pass
  765 + else:
  766 + wait["blacklist"][op.param2] = True
  767 + nadya.inviteIntoGroup(op.param1,[op.param3])
  768 + if op.param2 in wait["blacklist"]:
  769 + pass
  770 + if op.param2 in wait["whitelist"]:
  771 + pass
  772 + else:
  773 + wait["blacklist"][op.param2] = True
  774 +
  775 +
  776 + if op.type == 11:
  777 + if wait["Qr"] == True:
  778 + if op.param2 in Creator:
  779 + if op.param2 in admin:
  780 + if op.param2 in Bots:
  781 + pass
  782 + else:
  783 + nadya.kickoutFromGroup(op.param1,[op.param2])
  784 + else:
  785 + pass
  786 +
  787 +
  788 + if op.type == 17:
  789 + if wait["Sambutan"] == True:
  790 + if op.param2 in Creator:
  791 + return
  792 + ginfo = nadya.getGroup(op.param1)
  793 + contact = nadya.getContact(op.param2)
  794 + image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus
  795 + nadya.sendText(op.param1,"Hallo " + nadya.getContact(op.param2).displayName + "\nWelcome To ☞ " + str(ginfo.name) + " ☜" + "\nBudayakan Cek Note\nDan Semoga Betah Disini ^_^")
  796 + c = Message(to=op.param1, from_=None, text=None, contentType=13)
  797 + c.contentMetadata={'mid':op.param2}
  798 + nadya.sendMessage(c)
  799 + nadya.sendImageWithURL(op.param1,image)
  800 + d = Message(to=op.param1, from_=None, text=None, contentType=7)
  801 + d.contentMetadata={
  802 + "STKID": "13269548",
  803 + "STKPKGID": "1329191",
  804 + "STKVER": "1" }
  805 + nadya.sendMessage(d)
  806 + print "MEMBER JOIN TO GROUP"
  807 +
  808 + if op.type == 15:
  809 + if wait["Sambutan"] == True:
  810 + if op.param2 in Creator:
  811 + return
  812 + nadya.sendText(op.param1,"Good Bye " + nadya.getContact(op.param2).displayName + "\nSee You Next Time . . . (p′︵‵。) 🤗")
  813 + d = Message(to=op.param1, from_=None, text=None, contentType=7)
  814 + d.contentMetadata={
  815 + "STKID": "13269542",
  816 + "STKPKGID": "1329191",
  817 + "STKVER": "1" }
  818 + nadya.sendMessage(d)
  819 + print "MEMBER HAS LEFT THE GROUP"
  820 +
  821 + if op.type == 26:
  822 + msg = op.message
  823 +
  824 + if msg.from_ in mimic["target"] and mimic["status"] == True and mimic["target"][msg.from_] == True:
  825 + text = msg.text
  826 + if text is not None:
  827 + nadya.sendText(msg.to,text)
  828 +
  829 +
  830 + if msg.to in settings["simiSimi"]:
  831 + if settings["simiSimi"][msg.to] == True:
  832 + if msg.text is not None:
  833 + text = msg.text
  834 + r = requests.get("http://api.ntcorp.us/chatbot/v1/?text=" + text.replace(" ","+") + "&key=beta1.nt")
  835 + data = r.text
  836 + data = json.loads(data)
  837 + if data['status'] == 200:
  838 + if data['result']['result'] == 100:
  839 + nadya.sendText(msg.to,data['result']['response'].encode('utf-8'))
  840 +
  841 + if 'MENTION' in msg.contentMetadata.keys() != None:
  842 + if wait["kickMention"] == True:
  843 + contact = nadya.getContact(msg.from_)
  844 + cName = contact.displayName
  845 + balas = ["Aku Bilang Jangan Ngetag Lagi " + cName + "\nAku Kick Kamu! Sorry, Byee!!!"]
  846 + ret_ = random.choice(balas)
  847 + name = re.findall(r'@(\w+)', msg.text)
  848 + mention = ast.literal_eval(msg.contentMetadata['MENTION'])
  849 + mentionees = mention['MENTIONEES']
  850 + for mention in mentionees:
  851 + if mention['M'] in Bots:
  852 + nadya.sendText(msg.to,ret_)
  853 + nadya.kickoutFromGroup(msg.to,[msg.from_])
  854 + break
  855 +
  856 + if 'MENTION' in msg.contentMetadata.keys() != None:
  857 + if wait["detectMention"] == True:
  858 + contact = nadya.getContact(msg.from_)
  859 + cName = contact.displayName
  860 + balas = ["Dont Tag!! Lagi Sibuk",cName + " Ngapain Ngetag?",cName + " Nggak Usah Tag-Tag! Kalo Penting Langsung Pc Aja","Dia Lagi Off", cName + " Kenapa Tag Saya?","Dia Lagi Tidur\nJangan Di Tag " + cName, "Jangan Suka Tag Gua " + cName, "Kamu Siapa " + cName + "?", "Ada Perlu Apa " + cName + "?","Woii " + cName + " Jangan Ngetag, Riibut!"]
  861 + ret_ = random.choice(balas)
  862 + name = re.findall(r'@(\w+)', msg.text)
  863 + mention = ast.literal_eval(msg.contentMetadata['MENTION'])
  864 + mentionees = mention['MENTIONEES']
  865 + for mention in mentionees:
  866 + if mention['M'] in Bots:
  867 + nadya.sendText(msg.to,ret_)
  868 + break
  869 +
  870 + if 'MENTION' in msg.contentMetadata.keys() != None:
  871 + if wait["detectMention2"] == True:
  872 + contact = nadya.getContact(msg.from_)
  873 + cName = contact.displayName
  874 + balas = ["Sekali lagi nge tag gw sumpahin jomblo seumur hidup!","Nggak Usah Tag-Tag! Kalo Penting Langsung Pc Aja","Woii " + cName + " Jangan Ngetag, Riibut!"]
  875 + ret_ = random.choice(balas)
  876 + name = re.findall(r'@(\w+)', msg.text)
  877 + mention = ast.literal_eval(msg.contentMetadata['MENTION'])
  878 + mentionees = mention['MENTIONEES']
  879 + for mention in mentionees:
  880 + if mention['M'] in Bots:
  881 + nadya.sendText(msg.to,ret_)
  882 + msg.contentType = 7
  883 + msg.text = None
  884 + msg.contentMetadata = {
  885 + "STKID": "20001316",
  886 + "STKPKGID": "1582380",
  887 + "STKVER": "1" }
  888 + nadya.sendMessage(msg)
  889 + break
  890 +
  891 + if 'MENTION' in msg.contentMetadata.keys() != None:
  892 + if wait["detectMention3"] == True:
  893 + contact = nadya.getContact(msg.from_)
  894 + cName = contact.displayName
  895 + balas = ["Woii " + cName + ", Dasar Jones Ngetag Mulu!"]
  896 + balas1 = "Ini Foto Sii Jones Yang Suka Ngetag. . ."
  897 + ret_ = random.choice(balas)
  898 + image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus
  899 + name = re.findall(r'@(\w+)', msg.text)
  900 + mention = ast.literal_eval(msg.contentMetadata['MENTION'])
  901 + mentionees = mention['MENTIONEES']
  902 + for mention in mentionees:
  903 + if mention['M'] in Bots:
  904 + nadya.sendText(msg.to,ret_)
  905 + nadya.sendText(msg.to,balas1)
  906 + nadya.sendImageWithURL(msg.to,image)
  907 + msg.contentType = 7
  908 + msg.text = None
  909 + msg.contentMetadata = {
  910 + "STKID": "11764508",
  911 + "STKPKGID": "6641",
  912 + "STKVER": "1" }
  913 + nadya.sendMessage(msg)
  914 + break
  915 +
  916 + if op.type == 25:
  917 + msg = op.message
  918 +
  919 + if msg.text in ["Bot on"]:
  920 + wait["Bot"] = True
  921 + nadya.sendText(msg.to,"Bot Sudah On Kembali.")
  922 +
  923 + if op.type == 25:
  924 + if wait["Bot"] == True:
  925 + msg = op.message
  926 +
  927 +
  928 + if msg.contentType == 7:
  929 + if wait["sticker"] == True:
  930 + msg.contentType = 0
  931 + stk_id = msg.contentMetadata['STKID']
  932 + stk_ver = msg.contentMetadata['STKVER']
  933 + pkg_id = msg.contentMetadata['STKPKGID']
  934 + filler = "『 Sticker Check 』\nSTKID : %s\nSTKPKGID : %s\nSTKVER : %s\n『 Link 』\nline://shop/detail/%s" % (stk_id,pkg_id,stk_ver,pkg_id)
  935 + nadya.sendText(msg.to, filler)
  936 + wait["sticker"] = False
  937 + else:
  938 + pass
  939 +
  940 + if wait["alwaysRead"] == True:
  941 + if msg.toType == 0:
  942 + nadya.sendChatChecked(msg.from_,msg.id)
  943 + else:
  944 + nadya.sendChatChecked(msg.to,msg.id)
  945 +
  946 +
  947 + if msg.contentType == 16:
  948 + if wait['likeOn'] == True:
  949 + url = msg.contentMetadata["postEndUrl"]
  950 + nadya.like(url[25:58], url[66:], likeType=1005)
  951 + nadya.comment(url[25:58], url[66:], wait["comment"])
  952 + nadya.sendText(msg.to,"Like Success")
  953 + wait['likeOn'] = False
  954 +
  955 +
  956 + if msg.contentType == 13:
  957 + if wait["wblacklist"] == True:
  958 + if msg.contentMetadata["mid"] not in admin:
  959 + if msg.contentMetadata["mid"] in wait["blacklist"]:
  960 + nadya.sendText(msg.to,"Sudah")
  961 + wait["wblacklist"] = False
  962 + else:
  963 + wait["blacklist"][msg.contentMetadata["mid"]] = True
  964 + wait["wblacklist"] = False
  965 + nadya.sendText(msg.to,"Ditambahkan")
  966 + else:
  967 + nadya.sendText(msg.to,"Admin Detected~")
  968 +
  969 +
  970 + elif wait["dblacklist"] == True:
  971 + if msg.contentMetadata["mid"] in wait["blacklist"]:
  972 + del wait["blacklist"][msg.contentMetadata["mid"]]
  973 + nadya.sendText(msg.to,"Terhapus")
  974 + wait["dblacklist"] = False
  975 +
  976 + else:
  977 + wait["dblacklist"] = False
  978 + nadya.sendText(msg.to,"Tidak Ada Black List")
  979 +
  980 +
  981 +
  982 + elif wait["Contact"] == True:
  983 + msg.contentType = 0
  984 + nadya.sendText(msg.to,msg.contentMetadata["mid"])
  985 + if 'displayName' in msg.contentMetadata:
  986 + contact = nadya.getContact(msg.contentMetadata["mid"])
  987 + try:
  988 + cu = nadya.channel.getCover(msg.contentMetadata["mid"])
  989 + except:
  990 + cu = ""
  991 + nadya.sendText(msg.to,"Nama:\n" + msg.contentMetadata["displayName"] + "\n\nMid:\n" + msg.contentMetadata["mid"] + "\n\nStatus:\n" + contact.statusMessage + "\n\nPhoto Profile:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n\nPhoto Cover:\n" + str(cu))
  992 + else:
  993 + contact = nadya.getContact(msg.contentMetadata["mid"])
  994 + try:
  995 + cu = nadya.channel.getCover(msg.contentMetadata["mid"])
  996 + except:
  997 + cu = ""
  998 + nadya.sendText(msg.to,"Nama:\n" + msg.contentMetadata["displayName"] + "\n\nMid:\n" + msg.contentMetadata["mid"] + "\n\nStatus:\n" + contact.statusMessage + "\n\nPhoto Profile:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n\nPhoto Cover:\n" + str(cu))
  999 +
  1000 +
  1001 +
  1002 + elif msg.text == "Ginfo":
  1003 + if msg.toType == 2:
  1004 + ginfo = nadya.getGroup(msg.to)
  1005 + try:
  1006 + gCreator = ginfo.creator.displayName
  1007 + except:
  1008 + gCreator = "Error"
  1009 + if wait["lang"] == "JP":
  1010 + if ginfo.invitee is None:
  1011 + sinvitee = "0"
  1012 + else:
  1013 + sinvitee = str(len(ginfo.invitee))
  1014 + if ginfo.preventJoinByTicket == True:
  1015 + u = "close"
  1016 + else:
  1017 + u = "open"
  1018 + nadya.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")
  1019 + else:
  1020 + nadya.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)
  1021 + else:
  1022 + if wait["lang"] == "JP":
  1023 + nadya.sendText(msg.to,"Can not be used outside the group")
  1024 + else:
  1025 + nadya.sendText(msg.to,"Not for use less than group")
  1026 +
  1027 +
  1028 +
  1029 + elif msg.text is None:
  1030 + return
  1031 +
  1032 + elif msg.text in ["Creator","Owner"]:
  1033 + msg.contentType = 13
  1034 + msg.contentMetadata = {'mid': tjia}
  1035 + nadya.sendMessage(msg)
  1036 + nadya.sendText(msg.to,"Itu Majikan Kami (^_^)")
  1037 +
  1038 +
  1039 +
  1040 + elif msg.text in ["Group creator","Gcreator","gcreator"]:
  1041 + ginfo = nadya.getGroup(msg.to)
  1042 + gCreator = ginfo.creator.mid
  1043 + msg.contentType = 13
  1044 + msg.contentMetadata = {'mid': gCreator}
  1045 + nadya.sendMessage(msg)
  1046 + nadya.sendText(msg.to,"Itu Yang Buat Grup Ini")
  1047 +
  1048 +
  1049 +
  1050 + elif msg.contentType == 16:
  1051 + if wait["Timeline"] == True:
  1052 + msg.contentType = 0
  1053 + msg.text = "post URL\n" + msg.contentMetadata["postEndUrl"]
  1054 + nadya.sendText(msg.to,msg.text)
  1055 +
  1056 +
  1057 + if msg.contentType == 13:
  1058 + if wait["steal"] == True:
  1059 + _name = msg.contentMetadata["displayName"]
  1060 + copy = msg.contentMetadata["mid"]
  1061 + groups = nadya.getGroup(msg.to)
  1062 + pending = groups.invitee
  1063 + targets = []
  1064 + for s in groups.members:
  1065 + if _name in s.displayName:
  1066 + print "[Target] Stealed"
  1067 + break
  1068 + else:
  1069 + targets.append(copy)
  1070 + if targets == []:
  1071 + pass
  1072 + else:
  1073 + for target in targets:
  1074 + try:
  1075 + nadya.findAndAddContactsByMid(target)
  1076 + contact = nadya.getContact(target)
  1077 + cu = nadya.channel.getCover(target)
  1078 + path = str(cu)
  1079 + image = "http://dl.profile.line-cdn.net/" + contact.pictureStatus
  1080 + nadya.sendText(msg.to,"Nama :\n" + contact.displayName + "\n\nMid :\n" + msg.contentMetadata["mid"] + "\n\nBio :\n" + contact.statusMessage)
  1081 + nadya.sendText(msg.to,"Profile Picture " + contact.displayName)
  1082 + nadya.sendImageWithURL(msg.to,image)
  1083 + nadya.sendText(msg.to,"Cover " + contact.displayName)
  1084 + nadya.sendImageWithURL(msg.to,path)
  1085 + wait["steal"] = False
  1086 + break
  1087 + except:
  1088 + pass
  1089 +
  1090 +
  1091 + if msg.contentType == 13:
  1092 + if wait["gift"] == True:
  1093 + _name = msg.contentMetadata["displayName"]
  1094 + copy = msg.contentMetadata["mid"]
  1095 + groups = nadya.getGroup(msg.to)
  1096 + pending = groups.invitee
  1097 + targets = []
  1098 + for s in groups.members:
  1099 + if _name in s.displayName:
  1100 + print "[Target] Gift"
  1101 + break
  1102 + else:
  1103 + targets.append(copy)
  1104 + if targets == []:
  1105 + pass
  1106 + else:
  1107 + for target in targets:
  1108 + try:
  1109 + nadya.sendText(msg.to,"Gift Sudah Terkirim!")
  1110 + msg.contentType = 9
  1111 + msg.contentMetadata= {'PRDTYPE': 'STICKER',
  1112 + 'STKVER': '1',
  1113 + 'MSGTPL': '1',
  1114 + 'STKPKGID': '1296261'}
  1115 + msg.to = target
  1116 + msg.text = None
  1117 + nadya.sendMessage(msg)
  1118 + wait['gift'] = False
  1119 + break
  1120 + except:
  1121 + msg.contentMetadata = {'mid': target}
  1122 + wait["gift"] = False
  1123 + break
  1124 +
  1125 + if msg.contentType == 13:
  1126 + if wait["copy"] == True:
  1127 + _name = msg.contentMetadata["displayName"]
  1128 + copy = msg.contentMetadata["mid"]
  1129 + groups = nadya.getGroup(msg.to)
  1130 + targets = []
  1131 + for s in groups.members:
  1132 + if _name in s.displayName:
  1133 + print "[Target] Copy"
  1134 + break
  1135 + else:
  1136 + targets.append(copy)
  1137 + if targets == []:
  1138 + nadya.sendText(msg.to, "Not Found...")
  1139 + pass
  1140 + else:
  1141 + for target in targets:
  1142 + try:
  1143 + nadya.CloneContactProfile(target)
  1144 + nadya.sendText(msg.to, "Copied (^_^)")
  1145 + wait['copy'] = False
  1146 + break
  1147 + except:
  1148 + msg.contentMetadata = {'mid': target}
  1149 + wait["copy"] = False
  1150 + break
  1151 +
  1152 +
  1153 + if msg.contentType == 13:
  1154 + if wait['invite'] == True:
  1155 + _name = msg.contentMetadata["displayName"]
  1156 + invite = msg.contentMetadata["mid"]
  1157 + groups = nadya.getGroup(msg.to)
  1158 + pending = groups.invitee
  1159 + targets = []
  1160 + for s in groups.members:
  1161 + if _name in s.displayName:
  1162 + nadya.sendText(msg.to, _name + " Berada DiGrup Ini")
  1163 + else:
  1164 + targets.append(invite)
  1165 + if targets == []:
  1166 + pass
  1167 + else:
  1168 + for target in targets:
  1169 + try:
  1170 + nadya.findAndAddContactsByMid(target)
  1171 + nadya.inviteIntoGroup(msg.to,[target])
  1172 + nadya.sendText(msg.to,"Invite " + _name)
  1173 + wait['invite'] = False
  1174 + break
  1175 + except:
  1176 + nadya.sendText(msg.to,"Limit Invite")
  1177 + wait['invite'] = False
  1178 + break
  1179 +
  1180 +
  1181 + elif msg.text in ["Key creator","help creator","Help creator"]:
  1182 + nadya.sendText(msg.to,creatorMessage)
  1183 +
  1184 + elif msg.text in ["Key group","help group","Help group"]:
  1185 + nadya.sendText(msg.to,groupMessage)
  1186 +
  1187 + elif msg.text in ["Key","help","Help"]:
  1188 + nadya.sendText(msg.to,helpMessage)
  1189 +
  1190 + elif msg.text in ["Key self","help self","Help self"]:
  1191 + nadya.sendText(msg.to,selfMessage)
  1192 +
  1193 + elif msg.text in ["Key bot","help bot","Help bot"]:
  1194 + nadya.sendText(msg.to,botMessage)
  1195 +
  1196 + elif msg.text in ["Key set","help set","Help set"]:
  1197 + nadya.sendText(msg.to,setMessage)
  1198 +
  1199 + elif msg.text in ["Key media","help media","Help media"]:
  1200 + nadya.sendText(msg.to,mediaMessage)
  1201 +
  1202 + elif msg.text in ["Key admin","help admin","Help admin"]:
  1203 + nadya.sendText(msg.to,adminMessage)
  1204 +
  1205 +
  1206 +
  1207 + elif msg.text in ["List group"]:
  1208 + gid = nadya.getGroupIdsJoined()
  1209 + h = ""
  1210 + jml = 0
  1211 + for i in gid:
  1212 + gn = nadya.getGroup(i).name
  1213 + h += "♦【%s】\n" % (gn)
  1214 + jml += 1
  1215 + nadya.sendText(msg.to,"=======[List Group]=======\n"+ h +"\nTotal Group: "+str(jml))
  1216 +
  1217 + elif "Ban group: " in msg.text:
  1218 + grp = msg.text.replace("Ban group: ","")
  1219 + gid = nadya.getGroupIdsJoined()
  1220 + if msg.from_ in admin:
  1221 + for i in gid:
  1222 + h = nadya.getGroup(i).name
  1223 + if h == grp:
  1224 + wait["BlGroup"][i]=True
  1225 + nadya.sendText(msg.to, "Success Ban Group : "+grp)
  1226 + else:
  1227 + pass
  1228 + else:
  1229 + nadya.sendText(msg.to, "Khusus Nadya")
  1230 +
  1231 + elif msg.text in ["List ban","List ban group"]:
  1232 + if msg.from_ in admin:
  1233 + if wait["BlGroup"] == {}:
  1234 + nadya.sendText(msg.to,"Tidak Ada")
  1235 + else:
  1236 + mc = ""
  1237 + for gid in wait["BlGroup"]:
  1238 + mc += "-> " +nadya.getGroup(gid).name + "\n"
  1239 + nadya.sendText(msg.to,"===[Ban Group]===\n"+mc)
  1240 + else:
  1241 + nadya.sendText(msg.to, "Khusus Admin")
  1242 +
  1243 + elif msg.text in ["Del ban: "]:
  1244 + if msg.from_ in admin:
  1245 + ng = msg.text.replace("Del ban: ","")
  1246 + for gid in wait["BlGroup"]:
  1247 + if nadya.getGroup(gid).name == ng:
  1248 + del wait["BlGroup"][gid]
  1249 + nadya.sendText(msg.to, "Success del ban "+ng)
  1250 + else:
  1251 + pass
  1252 + else:
  1253 + nadya.sendText(msg.to, "Khusus Nadya")
  1254 +
  1255 + elif "Join group: " in msg.text:
  1256 + ng = msg.text.replace("Join group: ","")
  1257 + gid = nadya.getGroupIdsJoined()
  1258 + try:
  1259 + if msg.from_ in Creator:
  1260 + for i in gid:
  1261 + h = nadya.getGroup(i).name
  1262 + if h == ng:
  1263 + nadya.inviteIntoGroup(i,[Creator])
  1264 + nadya.sendText(msg.to,"Success Join To ["+ h +"] Group")
  1265 + else:
  1266 + pass
  1267 + else:
  1268 + nadya.sendText(msg.to,"Khusus Nadya")
  1269 + except Exception as e:
  1270 + nadya.sendText(msg.to, str(e))
  1271 +
  1272 + elif "Leave group: " in msg.text:
  1273 + ng = msg.text.replace("Leave group: ","")
  1274 + gid = nadya.getGroupIdsJoined()
  1275 + if msg.from_ in Creator:
  1276 + for i in gid:
  1277 + h = nadya.getGroup(i).name
  1278 + if h == ng:
  1279 + nadya.sendText(i,"Bot Di Paksa Keluar Oleh Owner!")
  1280 + nadya.leaveGroup(i)
  1281 + nadya.sendText(msg.to,"Success Left ["+ h +"] group")
  1282 + else:
  1283 + pass
  1284 + else:
  1285 + nadya.sendText(msg.to,"Khusus Nadya")
  1286 +
  1287 + elif "Leave all group" == msg.text:
  1288 + gid = nadya.getGroupIdsJoined()
  1289 + if msg.from_ in Creator:
  1290 + for i in gid:
  1291 + nadya.sendText(i,"Bot Di Paksa Keluar Oleh Owner!")
  1292 + nadya.leaveGroup(i)
  1293 + nadya.sendText(msg.to,"Success Leave All Group")
  1294 + else:
  1295 + nadya.sendText(msg.to,"Khusus Nadya")
  1296 +
  1297 +
  1298 + elif "Pict group: " in msg.text:
  1299 + saya = msg.text.replace('Pict group: ','')
  1300 + gid = nadya.getGroupIdsJoined()
  1301 + for i in gid:
  1302 + h = nadya.getGroup(i).name
  1303 + gna = nadya.getGroup(i)
  1304 + if h == saya:
  1305 + nadya.sendImageWithURL(msg.to,"http://dl.profile.line.naver.jp/"+ gna.pictureStatus)
  1306 +
  1307 +
  1308 + elif msg.text in ["cancelall","Cancelall"]:
  1309 + if msg.toType == 2:
  1310 + X = nadya.getGroup(msg.to)
  1311 + if X.invitee is not None:
  1312 + gInviMids = [contact.mid for contact in X.invitee]
  1313 + nadya.cancelGroupInvitation(msg.to, gInviMids)
  1314 + else:
  1315 + nadya.sendText(msg.to,"Tidak Ada Yang Pending")
  1316 + else:
  1317 + nadya.sendText(msg.to,"Tidak Bisa Digunakan Diluar Group")
  1318 +
  1319 + elif msg.text in ["Ourl","Url on"]:
  1320 + if msg.toType == 2:
  1321 + X = nadya.getGroup(msg.to)
  1322 + X.preventJoinByTicket = False
  1323 + nadya.updateGroup(X)
  1324 + nadya.sendText(msg.to,"Url Sudah Aktif")
  1325 + else:
  1326 + nadya.sendText(msg.to,"Can not be used outside the group")
  1327 +
  1328 + elif msg.text in ["Curl","Url off"]:
  1329 + if msg.toType == 2:
  1330 + X = nadya.getGroup(msg.to)
  1331 + X.preventJoinByTicket = True
  1332 + nadya.updateGroup(X)
  1333 + nadya.sendText(msg.to,"Url Sudah Di Nonaktifkan")
  1334 +
  1335 + else:
  1336 + nadya.sendText(msg.to,"Can not be used outside the group")
  1337 +
  1338 + elif msg.text in ["Join on","Autojoin on"]:
  1339 + if msg.from_ in admin:
  1340 + wait["AutoJoin"] = True
  1341 + wait["AutoJoinCancel"] = False
  1342 + nadya.sendText(msg.to,"Auto Join Sudah Aktif")
  1343 + else:
  1344 + nadya.sendText(msg.to,"Khusus Nadya")
  1345 +
  1346 + elif msg.text in ["Join off","Autojoin off"]:
  1347 + if msg.from_ in admin:
  1348 + wait["AutoJoin"] = False
  1349 + nadya.sendText(msg.to,"Auto Join Sudah Di Nonaktifkan")
  1350 + else:
  1351 + nadya.sendText(msg.to,"Khusus Nadya")
  1352 +
  1353 +
  1354 + elif msg.text in ["Joincancel on","Autojoincancel on"]:
  1355 + if msg.from_ in admin:
  1356 + wait["AutoJoinCancel"] = True
  1357 + wait["AutoJoin"] = False
  1358 + nadya.sendText(msg.to,"Auto Join Cancel Sudah Aktif")
  1359 + else:
  1360 + nadya.sendText(msg.to,"Khusus Nadya")
  1361 +
  1362 + elif msg.text in ["Joincancel off","Autojoincancel off"]:
  1363 + if msg.from_ in admin:
  1364 + wait["AutoJoinCancel"] = False
  1365 + nadya.sendText(msg.to,"Auto Join Cancel Sudah Di Nonaktifkan")
  1366 + else:
  1367 + nadya.sendText(msg.to,"Khusus Nadya")
  1368 +
  1369 +
  1370 + elif msg.text in ["Respon1 on"]:
  1371 + if msg.from_ in admin:
  1372 + wait["detectMention"] = True
  1373 + wait["detectMention2"] = False
  1374 + wait["detectMention3"] = False
  1375 + wait["kickMention"] = False
  1376 + nadya.sendText(msg.to,"Auto Respon1 Sudah Aktif")
  1377 + else:
  1378 + nadya.sendText(msg.to,"Khusus Nadya")
  1379 +
  1380 + elif msg.text in ["Respon1 off"]:
  1381 + if msg.from_ in admin:
  1382 + wait["detectMention"] = False
  1383 + nadya.sendText(msg.to,"Auto Respon1 Sudah Off")
  1384 + else:
  1385 + nadya.sendText(msg.to,"Khusus Nadya")
  1386 +
  1387 +
  1388 + elif msg.text in ["Respon2 on"]:
  1389 + if msg.from_ in admin:
  1390 + wait["detectMention"] = False
  1391 + wait["detectMention2"] = True
  1392 + wait["detectMention3"] = False
  1393 + wait["kickMention"] = False
  1394 + nadya.sendText(msg.to,"Auto Respon2 Sudah Aktif")
  1395 + else:
  1396 + nadya.sendText(msg.to,"Khusus Nadya")
  1397 + elif msg.text in ["Respon2 off"]:
  1398 + if msg.from_ in admin:
  1399 + wait["detectMention2"] = False
  1400 + nadya.sendText(msg.to,"Auto Respon2 Sudah Off")
  1401 + else:
  1402 + nadya.sendText(msg.to,"Khusus Nadya")
  1403 +
  1404 +
  1405 + elif msg.text in ["Respon3 on"]:
  1406 + if msg.from_ in admin:
  1407 + wait["detectMention"] = False
  1408 + wait["detectMention2"] = False
  1409 + wait["detectMention3"] = True
  1410 + wait["kickMention"] = False
  1411 + nadya.sendText(msg.to,"Auto Respon3 Sudah Aktif")
  1412 + else:
  1413 + nadya.sendText(msg.to,"Khusus Nadya")
  1414 +
  1415 + elif msg.text in ["Respon3 off"]:
  1416 + if msg.from_ in admin:
  1417 + wait["detectMention3"] = False
  1418 + nadya.sendText(msg.to,"Auto Respon3 Sudah Off")
  1419 + else:
  1420 + nadya.sendText(msg.to,"Khusus Nadya")
  1421 +
  1422 +
  1423 + elif msg.text in ["Responkick on"]:
  1424 + if msg.from_ in admin:
  1425 + wait["kickMention"] = True
  1426 + wait["detectMention"] = False
  1427 + wait["detectMention2"] = False
  1428 + wait["detectMention3"] = False
  1429 + nadya.sendText(msg.to,"Auto Respon Kick Sudah Aktif")
  1430 + else:
  1431 + nadya.sendText(msg.to,"Khusus Nadya")
  1432 +
  1433 + elif msg.text in ["Responkick off"]:
  1434 + if msg.from_ in admin:
  1435 + wait["kickMention"] = False
  1436 + nadya.sendText(msg.to,"Auto Respon Kick Sudah Off")
  1437 + else:
  1438 + nadya.sendText(msg.to,"Khusus Nadya")
  1439 +
  1440 +
  1441 + elif msg.text in ["Autocancel on"]:
  1442 + if msg.from_ in admin:
  1443 + wait["AutoCancel"] = True
  1444 + nadya.sendText(msg.to,"Auto Cancel Sudah Aktif")
  1445 + print wait["AutoCancel"]
  1446 + else:
  1447 + nadya.sendText(msg.to,"Khusus Nadya")
  1448 +
  1449 + elif msg.text in ["Autocancel off"]:
  1450 + if msg.from_ in admin:
  1451 + wait["AutoCancel"] = False
  1452 + nadya.sendText(msg.to,"Auto Cancel Sudah Di Nonaktifkan")
  1453 + print wait["AutoCancel"]
  1454 + else:
  1455 + nadya.sendText(msg.to,"Khusus Nadya")
  1456 +
  1457 +
  1458 + elif msg.text in ["Invitepro on"]:
  1459 + if msg.from_ in admin:
  1460 + wait["inviteprotect"] = True
  1461 + nadya.sendText(msg.to,"Invite Protect Sudah Aktif")
  1462 + print wait["inviteprotect"]
  1463 + else:
  1464 + nadya.sendText(msg.to,"Khusus Nadya")
  1465 +
  1466 + elif msg.text in ["Invitepro off"]:
  1467 + if msg.from_ in admin:
  1468 + wait["inviteprotect"] = False
  1469 + nadya.sendText(msg.to,"Invite Protect Sudah Di Nonaktifkan")
  1470 + print wait["inviteprotect"]
  1471 + else:
  1472 + nadya.sendText(msg.to,"Khusus Nadya")
  1473 +
  1474 + elif "Qr on" in msg.text:
  1475 + if msg.from_ in admin:
  1476 + wait["Qr"] = True
  1477 + nadya.sendText(msg.to,"QR Protect Sudah Aktif")
  1478 + else:
  1479 + nadya.sendText(msg.to,"Khusus Nadya")
  1480 +
  1481 + elif "Qr off" in msg.text:
  1482 + if msg.from_ in admin:
  1483 + wait["Qr"] = False
  1484 + nadya.sendText(msg.to,"Qr Protect Sudah Di Nonaktifkan")
  1485 + else:
  1486 + nadya.sendText(msg.to,"Khusus Nadya")
  1487 +
  1488 +
  1489 +
  1490 + elif "Autokick on" in msg.text:
  1491 + if msg.from_ in admin:
  1492 + wait["AutoKick"] = True
  1493 + nadya.sendText(msg.to,"Auto Kick Sudah Aktif")
  1494 + else:
  1495 + nadya.sendText(msg.to,"Khusus Nadya")
  1496 +
  1497 + elif "Autokick off" in msg.text:
  1498 + if msg.from_ in admin:
  1499 + wait["AutoKick"] = False
  1500 + nadya.sendText(msg.to,"Auto Kick Sudah Di Nonaktifkan")
  1501 + else:
  1502 + nadya.sendText(msg.to,"Khusus Nadya")
  1503 +
  1504 +
  1505 + elif msg.text in ["Allprotect on"]:
  1506 + if msg.from_ in admin:
  1507 + wait["AutoCancel"] = True
  1508 + wait["inviteprotect"] = True
  1509 + wait["AutoKick"] = True
  1510 + wait["Qr"] = True
  1511 + nadya.sendText(msg.to,"All Protect Sudah Aktif Semua")
  1512 + else:
  1513 + nadya.sendText(msg.to,"Khusus Nadya")
  1514 +
  1515 + elif msg.text in ["Allprotect off"]:
  1516 + if msg.from_ in admin:
  1517 + wait["AutoCancel"] = False
  1518 + wait["inviteprotect"] = False
  1519 + wait["AutoKick"] = False
  1520 + wait["Qr"] = False
  1521 + nadya.sendText(msg.to,"All Protect Sudah Di Nonaktifkan Semua")
  1522 + else:
  1523 + nadya.sendText(msg.to,"Khusus Nadya")
  1524 +
  1525 +
  1526 + elif msg.text in ["K on","Contact on"]:
  1527 + wait["Contact"] = True
  1528 + nadya.sendText(msg.to,"Contact Sudah Aktif")
  1529 +
  1530 + elif msg.text in ["K off","Contact off"]:
  1531 + wait["Contact"] = False
  1532 + nadya.sendText(msg.to,"Contact Sudah Di Nonaktifkan")
  1533 +
  1534 +
  1535 + elif msg.text in ["Alwaysread on"]:
  1536 + wait["alwaysRead"] = True
  1537 + nadya.sendText(msg.to,"Always Read Sudah Aktif")
  1538 +
  1539 + elif msg.text in ["Alwaysread off"]:
  1540 + wait["alwaysRead"] = False
  1541 + nadya.sendText(msg.to,"Always Read Sudah Di Nonaktifkan")
  1542 +
  1543 +
  1544 + elif msg.text in ["Sambutan on"]:
  1545 + if wait["Sambutan"] == True:
  1546 + if wait["lang"] == "JP":
  1547 + nadya.sendText(msg.to,"Sambutan Di Aktifkanヾ(*´∀`*)ノ")
  1548 + else:
  1549 + wait["Sambutan"] = True
  1550 + if wait["lang"] == "JP":
  1551 + nadya.sendText(msg.to,"Sudah Onヽ(´▽`)/")
  1552 +
  1553 + elif msg.text in ["Sambutan off"]:
  1554 + if wait["Sambutan"] == False:
  1555 + if wait["lang"] == "JP":
  1556 + nadya.sendText(msg.to,"Sambutan Di Nonaktifkan( ^∇^)")
  1557 + else:
  1558 + wait["Sambutan"] = False
  1559 + if wait["lang"] == "JP":
  1560 + nadya.sendText(msg.to,"Sudah Off(p′︵‵。)")
  1561 +
  1562 +
  1563 + elif "Sider on" in msg.text:
  1564 + try:
  1565 + del cctv['point'][msg.to]
  1566 + del cctv['sidermem'][msg.to]
  1567 + del cctv['cyduk'][msg.to]
  1568 + except:
  1569 + pass
  1570 + cctv['point'][msg.to] = msg.id
  1571 + cctv['sidermem'][msg.to] = ""
  1572 + cctv['cyduk'][msg.to]=True
  1573 + wait["Sider"] = True
  1574 + nadya.sendText(msg.to,"Siap On Cek Sider")
  1575 +
  1576 + elif "Sider off" in msg.text:
  1577 + if msg.to in cctv['point']:
  1578 + cctv['cyduk'][msg.to]=False
  1579 + wait["Sider"] = False
  1580 + nadya.sendText(msg.to, "Cek Sider Off")
  1581 + else:
  1582 + nadya.sendText(msg.to, "Heh Belom Di Set")
  1583 +
  1584 +
  1585 + elif msg.text in ["Status"]:
  1586 + md = ""
  1587 + if wait["Sambutan"] == True: md+="╠➩✔️ Sambutan : On\n"
  1588 + else:md+="╠➩❌ Sambutan : Off\n"
  1589 + if wait["AutoJoin"] == True: md+="╠➩✔️ Auto Join : On\n"
  1590 + else: md +="╠➩❌ Auto Join : Off\n"
  1591 + if wait["AutoJoinCancel"] == True: md+="╠➩✔️ Auto Join Cancel : On\n"
  1592 + else: md +="╠➩❌ Auto Join Cancel : Off\n"
  1593 + if wait["Contact"] == True: md+="╠➩✔️ Info Contact : On\n"
  1594 + else: md+="╠➩❌ Info Contact : Off\n"
  1595 + if wait["AutoCancel"] == True:md+="╠➩✔️ Auto Cancel : On\n"
  1596 + else: md+= "╠➩❌ Auto Cancel : Off\n"
  1597 + if wait["inviteprotect"] == True:md+="╠➩✔️ Invite Protect : On\n"
  1598 + else: md+= "╠➩❌ Invite Protect : Off\n"
  1599 + if wait["Qr"] == True: md+="╠➩✔️ Qr Protect : On\n"
  1600 + else:md+="╠➩❌ Qr Protect : Off\n"
  1601 + if wait["AutoKick"] == True: md+="╠➩✔️ Auto Kick : On\n"
  1602 + else:md+="╠➩❌ Auto Kick : Off\n"
  1603 + if wait["alwaysRead"] == True: md+="╠➩✔️ Always Read : On\n"
  1604 + else:md+="╠➩❌ Always Read: Off\n"
  1605 + if wait["detectMention"] == True: md+="╠➩✔️ Auto Respon1 : On\n"
  1606 + else:md+="╠➩❌ Auto Respon1 : Off\n"
  1607 + if wait["detectMention2"] == True: md+="╠➩✔️ Auto Respon2 : On\n"
  1608 + else:md+="╠➩❌ Auto Respon2 : Off\n"
  1609 + if wait["detectMention3"] == True: md+="╠➩✔️ Auto Respon3 : On\n"
  1610 + else:md+="╠➩❌ Auto Respon3 : Off\n"
  1611 + if wait["kickMention"] == True: md+="╠➩✔️ Auto Respon Kick : On\n"
  1612 + else:md+="╠➩❌ Auto Respon Kick : Off\n"
  1613 + if wait["Sider"] == True: md+="╠➩✔️ Auto Sider : On\n"
  1614 + else:md+="╠➩❌ Auto Sider: Off\n"
  1615 + if wait["Simi"] == True: md+="╠➩✔️ Simisimi : On\n"
  1616 + else:md+="╠➩❌ Simisimi: Off\n"
  1617 + nadya.sendText(msg.to,"╔═════════════════════════\n""║ ☆☞ S T A T U S ☜☆\n""╠═════════════════════════\n"+md+"╚═════════════════════════")
  1618 +
  1619 +
  1620 + elif msg.text in ["Gift","gift"]:
  1621 + msg.contentType = 9
  1622 + msg.contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58',
  1623 + 'PRDTYPE': 'THEME',
  1624 + 'MSGTPL': '5'}
  1625 + msg.text = None
  1626 + nadya.sendMessage(msg)
  1627 +
  1628 +
  1629 + elif "Gift1 " in msg.text:
  1630 + msg.contentType = 13
  1631 + nk0 = msg.text.replace("Gift1 ","")
  1632 + nk1 = nk0.lstrip()
  1633 + nk2 = nk1.replace("@","")
  1634 + nk3 = nk2.rstrip()
  1635 + _name = nk3
  1636 + gs = nadya.getGroup(msg.to)
  1637 + targets = []
  1638 + for s in gs.members:
  1639 + if _name in s.displayName:
  1640 + targets.append(s.mid)
  1641 + if targets == []:
  1642 + sendMessage(msg.to,"user does not exist")
  1643 + pass
  1644 + else:
  1645 + for target in targets:
  1646 + try:
  1647 + nadya.sendText(msg.to,_name + " Check Your Gift")
  1648 + msg.contentType = 9
  1649 + msg.contentMetadata= {'PRDTYPE': 'STICKER',
  1650 + 'STKVER': '1',
  1651 + 'MSGTPL': '1',
  1652 + 'STKPKGID': '1380280'}
  1653 + msg.to = target
  1654 + msg.text = None
  1655 + nadya.sendMessage(msg)
  1656 + except:
  1657 + msg.contentMetadata = {'mid': target}
  1658 +
  1659 + elif "Gift2 " in msg.text:
  1660 + msg.contentType = 13
  1661 + nk0 = msg.text.replace("Gift2 ","")
  1662 + nk1 = nk0.lstrip()
  1663 + nk2 = nk1.replace("@","")
  1664 + nk3 = nk2.rstrip()
  1665 + _name = nk3
  1666 + gs = nadya.getGroup(msg.to)
  1667 + targets = []
  1668 + for s in gs.members:
  1669 + if _name in s.displayName:
  1670 + targets.append(s.mid)
  1671 + if targets == []:
  1672 + sendMessage(msg.to,"user does not exist")
  1673 + pass
  1674 + else:
  1675 + for target in targets:
  1676 + try:
  1677 + nadya.sendText(msg.to,_name + " Check Your Gift")
  1678 + msg.contentType = 9
  1679 + msg.contentMetadata= {'PRDTYPE': 'STICKER',
  1680 + 'STKVER': '1',
  1681 + 'MSGTPL': '2',
  1682 + 'STKPKGID': '1360738'}
  1683 + msg.to = target
  1684 + msg.text = None
  1685 + nadya.sendMessage(msg)
  1686 + except:
  1687 + msg.contentMetadata = {'mid': target}
  1688 +
  1689 + elif "Gift3 " in msg.text:
  1690 + msg.contentType = 13
  1691 + nk0 = msg.text.replace("Gift3 ","")
  1692 + nk1 = nk0.lstrip()
  1693 + nk2 = nk1.replace("@","")
  1694 + nk3 = nk2.rstrip()
  1695 + _name = nk3
  1696 + gs = nadya.getGroup(msg.to)
  1697 + targets = []
  1698 + for s in gs.members:
  1699 + if _name in s.displayName:
  1700 + targets.append(s.mid)
  1701 + if targets == []:
  1702 + sendMessage(msg.to,"user does not exist")
  1703 + pass
  1704 + else:
  1705 + for target in targets:
  1706 + try:
  1707 + nadya.sendText(msg.to,_name + " Check Your Gift")
  1708 + msg.contentType = 9
  1709 + msg.contentMetadata= {'PRDTYPE': 'STICKER',
  1710 + 'STKVER': '1',
  1711 + 'MSGTPL': '3',
  1712 + 'STKPKGID': '1395389'}
  1713 + msg.to = target
  1714 + msg.text = None