Wa0010
Wa0010
Wa0010
kimak= {
"Addaudio": False,
"Audio": {},
"Audios": {
},
}
nissa = {
"addTikel2": {
"name": "",
"status": False
},
}
anyun = {
"addTikel": {
"name": "",
"status": False
},
}
chatbot = {
"admin": [],
"botMute": [],
"botOff": [],
}
tes = {
"Message": {},
"msg": {},
}
tes2 = {
"Message2": {},
"msg2": {},
}
peler = {
"receivercount": 0,
"sendcount": 0
}
read = {
"readMember": {},
"readPoint": {}
}
lmao = {
"checkContact": False,
}
hoho = {
"savefile": False,
"namefile": "",
}
itil = {
"blacklist": {},
"wblacklist": {},
"whitelist": {},
"wwhitelist": False,
"dblacklist": False,
"dwhitelist": False,
}
apalo = {
"Talkblacklist": {},
"Talkwblacklist": False,
"Talkdblacklist": False,
"talkban": True,
}
ProfileMe = {
"myProfile": {
"coverId": "",
"pictureStatus": "",
"statusMessage": ""
},
"PictureMe": "",
"NameMe": "",
}
#=====================================================================
#=====================================================================
settings["myProfile"]["displayName"] = clientProfile.displayName
settings["myProfile"]["statusMessage"] = clientProfile.statusMessage
settings["myProfile"]["pictureStatus"] = clientProfile.pictureStatus
cont = client.getContact(clientMID)
settings["myProfile"]["videoProfile"] = cont.videoProfile
coverId = client.getProfileDetail()["result"]["objectId"]
settings["myProfile"]["coverId"] = coverId
ProfileMe["myProfile"]["statusMessage"] = clientProfile.statusMessage
ProfileMe["myProfile"]["pictureStatus"] = clientProfile.pictureStatus
coverId = client.getProfileDetail()["result"]["objectId"]
ProfileMe["myProfile"]["coverId"] = coverId
#=====================================================================
#=====================================================================
with open("temp.json", "r", encoding="utf_8_sig") as f:
anu = json.loads(f.read())
anu.update(settings)
settings = anu
with open("wait.json", "r", encoding="utf_8_sig") as f:
itu = json.loads(f.read())
itu.update(wait)
wait = itu
#=====================================================================
def autoLike():
while True:
if wait['autoLike']['status'] == True:
a = client.getFeed()
for i in a["result"]["feeds"]:
if i["post"]["postInfo"]["liked"] == False:
try:
client.likePost(i["post"]["userInfo"]["mid"],i["post"]
["postInfo"]["postId"],random.choice([1001,1002,1003,1004,1005]))
client.createComment(i["post"]["userInfo"]["mid"],i["post"]
["postInfo"]["postId"],""+wait['autoLike']['comment'])
print("Liked")
except Exception as e:
print(e)
pass
else:
pass
else:
pass
threads = threading.Thread(target=autoLike)
threads.daemon = True
threads.start()
def runtime(secs):
mins, secs = divmod(secs,60)
hours, mins = divmod(mins,60)
days, hours = divmod(hours, 24)
return '%02d d %02d h %02d m %02d s' % (days, hours, mins, secs)
def clons(to):
try:
contact = client.getContact(to)
profile = client.profile
profileName = client.profile
profileStatus = client.profile
profileName.displayName = contact.displayName
profileStatus.statusMessage = contact.statusMessage
client.updateProfile(profileName)
client.updateProfile(profileStatus)
profile.pictureStatus = client.downloadFileURL('http://dl.profile.line-
cdn.net/{}'.format(contact.pictureStatus, 'path'))
if client.getProfileCoverId(to) is not None:
client.updateProfileCoverById(cl.getProfileCoverId(to))
client.updateProfilePicture(profile.pictureStatus)
print("Success Clone Profile {}".format(contact.displayName))
return client.updateProfile(profile)
if contact.videoProfile == None:
return "Get Video Profile"
path2 = "http://dl.profile.line-cdn.net/" + profile.pictureStatus
client.updateProfilePicture(path2, 'vp')
except Exception as error:
print(error)
def ClonerV2(to):
try:
contact = client.getContact(to)
profile = client.profile
profileName = client.profile
profileStatus = client.profile
profileName.displayName = contact.displayName
profileStatus.statusMessage = contact.statusMessage
client.updateProfile(profileName)
client.updateProfile(profileStatus)
profile.pictureStatus = client.downloadFileURL('http://dl.profile.line-
cdn.net/{}'.format(contact.pictureStatus, 'path'))
if client.getProfileCoverId(to) is not None:
client.updateProfileCoverById(client.getProfileCoverId(to))
client.updateProfilePicture(profile.pictureStatus)
print("Success Clone Profile {}".format(contact.displayName))
return client.updateProfile(profile)
if contact.videoProfile == None:
return "Get Video Profile"
path2 = "http://dl.profile.line-cdn.net/" + profile.pictureStatus
client.updateProfilePicture(path2, 'vp')
except Exception as error:
print(error)
#=====================================================================
#def Template(to):
def NoteCreate(to,cmd,msg):
h = []
s = []
if cmd == 'mentionnote':
sakui = client.getProfile()
group = client.getGroup(msg.to);nama = [contact.mid+'||//
{}'.format(contact.displayName) for contact in
group.members];nama.remove(sakui.mid+'||//{}'.format(sakui.displayName))
data = nama
k = len(data)//20
for aa in range(k+1):
nos = 0
if aa == 0:dd = '╭「 Mention Note 」─';no=aa
else:dd = '├「 Mention Note 」─';no=aa*20
msgas = dd
for i in data[aa*20 : (aa+1)*20]:
no+=1
if no == len(data):msgas+='\n╰{}. @'.format(no)
else:msgas+='\n│{}. @'.format(no)
msgas = msgas
for i in data[aa*20 : (aa+1)*20]:
gg = []
dd = ''
for ss in msgas:
if ss == '@':
dd += str(ss)
gg.append(dd.index('@'))
dd = dd.replace('@',' ')
else:
dd += str(ss)
s.append({'type': "RECALL", 'start': gg[nos], 'end': gg[nos]+1,
'mid': str(i.split('||//')[0])})
nos +=1
h = client.createPostGroup(msgas,msg.to,holdingTime=None,textMeta=s)
else:
cmd = cmd.replace(msg.text[:12],'')
if 'MENTION' in msg.contentMetadata.keys()!= None:
mention = ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
no = 0
for mention in mentionees:
ask = no
nama = str(client.getContact(mention["M"]))
h.append(str(cmd.replace('@{}'.format(nama),'@')))
for b in h:
cmd = str(b)
gg = []
dd = ''
for ss in cmd:
if ss == '@':
dd += str(ss)
gg.append(dd.index('@'))
dd = dd.replace('@',' ')
else:
dd += str(ss)
s.append({'type': "RECALL", 'start': gg[no], 'end': gg[no]+1,
'mid': str(mention["M"])})
no +=1
h = client.createPostGroup(cmd,msg.to,holdingTime=None,textMeta=s)
def cekmentions(to,wait,cmd):
try:
if to in wait['ROM']:
moneys = {}
for a in wait['ROM'][to].items():
moneys[a[0]] = [a[1]['msg.id'],a[1]['waktu'],a[1]['metadata'],a[1]
['text']] if a[1] is not None else idnya
sort = sorted(moneys)
sort.reverse()
sort = sort[0:]
msgas = ' 「 Mention Me 」'
if cmd == "mentionme":
try:
if to in wait['ROM']:
h = []
no = 0
for m in sort:
h.append(m)
no+=1
msgas+= '\n{}. @!{}x'.format(no,len(moneys[m][0]))
client.sendMention(to, msgas,' 「 Mention Me 」\n', h)
except:
try:
msgas = 'Sorry @!In {} nothink get a
mention'.format(client.getGroup(to).name)
client.sendMention(to, msgas,' 「 Mention Me 」\n',
[client.getProfile().mid])
except:
msgas = 'Sorry @!In Chat @!nothink get a mention'
client.sendMention(to, msgas,' 「 Mention Me 」\n',
[client.getProfile().mid,to])
if cmd.startswith('cek mention '):
if len(cmd.split(" ")) == 3:
asd = sort[int(cmd.split(" ")[2])-1]
nol = 0
msgas+= '\n - @! {}x Mention'.format(len(moneys[asd][0]))
h = [asd]
has = ''
anu = -1
numb = 0
try:
for kntl in moneys[asd][0]:
anu += 1
numb += 1
has+= '\n{}. line://nv/chatMsg?chatId={}&messageId={}
{}\n'.format(numb,to,kntl,humanize.naturaltime(datetime.fromtimestamp(moneys[asd]
[1][anu]/1000)))
for kucing in range(len(moneys[asd][3])):
nol+=1
if moneys[asd][3][kucing].count('@!') >= 21:
if nol == 1:msgas+= '\n{}. {}\nJust Tagall Or Spam
Tag > 20 Tag'.format(nol,humanize.naturaltime(datetime.fromtimestamp(moneys[asd][1]
[kucing]/1000)))
else:msgas+= '\n\n{}. {}\nJust Tagall Or Spam Tag >
20 Tag'.format(nol,humanize.naturaltime(datetime.fromtimestamp(moneys[asd][1]
[kucing]/1000)))
else:
for hhh in eval(moneys[asd][2][kucing]['MENTION'])
["MENTIONEES"]:
h.append(hhh['M'])
if nol == 1:msgas+= '\n{}. Text:
{}'.format(nol,moneys[asd][3][kucing])
else:msgas+= '\n{}. Text:
{}'.format(nol,moneys[asd][3][kucing])
dd = len(msgas.split('@!'))
k = dd//20
no=0
for a in range(k+1):
gg = ''
for b in msgas.split('@!')[a*20 : (a+1)*20]:
no+=1
if a == 0:
if no == len(msgas.split('@!')):gg+= b
else:gg+= b+'@!'
else:
if no == a+100:gg+= b.replace('\n','')+'@!'
else:
if no == len(msgas.split('@!')):gg+= b
else:gg+= b+'@!'
client.sendMention(to, gg+'\nLink: \n'+has,' 「 Mention
Me 」\n', h[a*20 : (a+1)*20])
#del wait['ROM'][to][asd]
except Exception as e:client.sendMessage(to,'ERROR
{}'.format(e))
else:
try:
msgas = 'Sorry @!In {} nothing get a
mention'.format(client.getGroup(to).name)
client.sendMention(to, msgas,' 「 Mention Me 」\n',
[client.getProfile().mid])
except:
msgas = 'Sorry @!In Chat @!nothing get a mention'
client.sendMention(to, msgas,' 「 Mention Me 」\n',
[client.getProfile().mid,to])
except Exception as error:
logError(error)
print(error)
def slyric(to,text):
try:
r = requests.get("https://api.genius.com/search?
q="+text+"&access_token=2j351ColWKXXVxq1PdUNXDYECI2x4zClLyyAJJkrIeX8K7AQ0F-
HTmWfG6tNVszO")
data = r.json()
hits = data["response"]["hits"][0]["result"]["api_path"]
title= "\nTitle: "+data["response"]["hits"][0]["result"]
["title"].strip()
oleh = "\nArtis: "+data["response"]["hits"][0]["result"]
["primary_artist"]["name"].strip()
g = data["response"]["hits"][0]["result"]
['song_art_image_thumbnail_url']
r1 = requests.get("https://api.genius.com"+hits+"?
&access_token=2j351ColWKXXVxq1PdUNXDYECI2x4zClLyyAJJkrIeX8K7AQ0F-HTmWfG6tNVszO")
data1 = r1.json()
path = data1["response"]["song"]["path"]
release = data1["response"]["song"]["release_date"]
page_url = "http://genius.com" + path
page = requests.get(page_url)
html = BeautifulSoup(page.text, "html.parser")
[h.extract() for h in html('script')]
lyrics = html.find("div", class_="lyrics").get_text().strip()
pesan = " 「 Lyric 」"+title+oleh+'\n'+lyrics
k = len(pesan)//10000
for aa in range(k+1):
client.sendMessage(to,'{}'.format(pesan[aa*10000 : (aa+1)*10000]))
except:
client.sendMessage(to,"「 404 」\nStatus: Error\nReason: I'cant found
lyric {}".format(text))
def sendMentionFooter(to, mid, firstmessage, lastmessage):
try:
arrData = ""
text = "%s " %(str(firstmessage))
arr = []
mention = "@LopeAgri"
slen = str(len(text))
elen = str(len(text) + len(mention))
arrData = {'S':slen, 'E':elen, 'M':mid}
arr.append(arrData)
text += mention + str(lastmessage)
nama = "{}".format(client.getContact(clientMID).displayName)
img = "http://dl.profile.line-cdn.net/
{}".format(client.getContact(clientMID).pictureStatus)
ticket = "https://line.me/ti/p/{}".format(client.getUserTicket().id)
client.sendMessage(to, text, {'AGENT_LINK': ticket, 'AGENT_ICON': img,
'AGENT_NAME': nama, 'MENTION': str('{"MENTIONEES":' + json.dumps(arr) + '}')}, 0)
except Exception as error:
logError(error)
client.sendMessage(to, "[ INFO ] Error :\n" + str(error))
def getTimeLine(to, mid):
data = client.getHomeProfile(mid)
if data['result'] != []:
try:
no = 1
a = " 「 Timeline 」\nCreated by : @!"#+str(data['result']
['homeInfo']['userInfo']['nickname'])
for i in data['result']['feeds']:
gtime = i['post']['postInfo']['createdTime']
timeCreated = []
timeCreated.append(time.strftime("%d-%m-%Y [ %H:%M:%S ]",
time.localtime(int(gtime) / 1000)))
try:
desc ="\n\n" + str(no) + ". Text : "+str(i['post']
['contents']['text'])
except:
desc ="\n\n" + str(no) + ". Text : None"
a += str(desc)
a +="\n Total Like : "+str(i['post']['postInfo']
['likeCount'])
a +="\n Total Comment : "+str(i['post']['postInfo']
['commentCount'])
a +="\n Created on : "+str(timeCreated[0])+"\n"
no = (no+1)
a +="\n\nTotal Post : "+str(data['result']['homeInfo']
['postCount'])+" Post."
return mentions(to,str(a), [mid])
except:
return mentions(to, "@! not have timeline", [mid])
def mentions(to, text="", mids=[]):
arrData = ""
arr = []
mention = "@KhieGans "
if mids == []:
raise Exception("Invalid mids")
if "@!" in text:
if text.count("@!") != len(mids):
raise Exception("Invalid mids")
texts = text.split("@!")
textx = ""
for mid in mids:
textx += str(texts[mids.index(mid)])
slen = len(textx)
elen = len(textx) + 15
arrData = {'S':str(slen), 'E':str(elen - 4), 'M':mid}
arr.append(arrData)
textx += mention
textx += str(texts[len(mids)])
else:
textx = ""
slen = len(textx)
elen = len(textx) + 15
arrData = {'S':str(slen), 'E':str(elen - 4), 'M':mids[0]}
arr.append(arrData)
textx += mention + str(text)
client.sendMessage(to, textx, {'AGENT_NAME':'LINE OFFICIAL', 'AGENT_LINK':
'line://ti/p/~{}'.format(client.getProfile().userid), 'AGENT_ICON':
"http://dl.profile.line-cdn.net/" +
client.getContact("u085311ecd9e3e3d74ae4c9f5437cbcb5").picturePath, 'MENTION':
str('{"MENTIONEES":' + json.dumps(arr) + '}')}, 0)
#=====================================================================
#=====================================================================
#=====================================================================
def load():
global images
global stickers
global stickerz
with open("image.json","r") as fp:
images = json.load(fp)
with open("sticker.json","r") as fp:
stickers = json.load(fp)
with open("stickerz.json","r") as fp:
stickerz = json.load(fp)
def sendStickers(to, sver, spkg, sid):
contentMetadata = {
'STKVER': sver,
'STKPKGID': spkg,
'STKID': sid
}
client.sendMessage(to, '', contentMetadata, 7)
def sendSticker(to, mid, sver, spkg, sid):
contentMetadata = {
'MSG_SENDER_NAME': client.getContact(mid).displayName,
'MSG_SENDER_ICON': 'http://dl.profile.line-cdn.net/' +
client.getContact(mid).pictureStatus,
'STKVER': sver,
'STKPKGID': spkg,
'STKID': sid
}
client.sendMessage(to, '', contentMetadata, 7)
def sendImage(to, path, name="image"):
try:
if settings["server"] == "VPS":
client.sendImageWithURL(to, str(path))
except Exception as error:
logError(error)
#=====================================================================
#=====================================================================
def changeVideoAndPictureProfile(pict, vids):
try:
files = {'file': open(vids, 'rb')}
obs_params = client.genOBSParams({'oid': clientMID, 'ver': '2.0', 'type':
'video', 'cat': 'vp.mp4'})
data = {'params': obs_params}
r_vp =
client.server.postContent('{}/talk/vp/upload.nhn'.format(str(client.server.LINE_OBS
_DOMAIN)), data=data, files=files)
if r_vp.status_code != 201:
return "Failed update profile"
client.updateProfilePicture(pict, 'vp')
return "Success update profile"
except Exception as e:
raise Exception("Error change video and picture profile {}".format(str(e)))
os.remove("FadhilvanHalen.mp4")
def changeProfileVideo(to):
if settings['changeProfileVideo']['picture'] == None:
return client.sendMessage(to, "Foto tidak ditemukan")
elif settings['changeProfileVideo']['video'] == None:
return client.sendMessage(to, "Video tidak ditemukan")
else:
path = settings['changeProfileVideo']['video']
files = {'file': open(path, 'rb')}
obs_params = client.genOBSParams({'oid': client.getProfile().mid, 'ver':
'2.0', 'type': 'video', 'cat': 'vp.mp4'})
data = {'params': obs_params}
r_vp =
client.server.postContent('{}/talk/vp/upload.nhn'.format(str(client.server.LINE_OBS
_DOMAIN)), data=data, files=files)
if r_vp.status_code != 201:
return client.sendMessage(to, "Gagal update profile")
path_p = settings['changeProfileVideo']['picture']
settings['changeProfileVideo']['status'] = False
client.updateProfilePicture(path_p, 'vp')
def backProfileVideo():
path = settings['changeProfileVideo']['video']
files = {'file': open(path, 'rb')}
obs_params = client.genOBSParams({'oid': client.getProfile().mid, 'ver': '2.0',
'type': 'video', 'cat': 'vp.mp4'})
data = {'params': obs_params }
r_vp =
client.server.postContent('{}/talk/vp/upload.nhn'.format(str(client.server.LINE_OBS
_DOMAIN)), data=data, files=files)
if r_vp.status_code != 201:
return client.sendMessage(to, "Failed")
path_p = settings['changeProfileVideo']['picture']
client.updateProfilePicture(path_p, 'vp')
def cytmp4(to,url):
import pafy
vid = pafy.new(url,basic=False)
result = vid.streams[-1]
return result.url
links = cytmp4(anunya);links = 'https://'+client.google_url_shorten(links)
def pendekin(to,url):
req_url = 'https://www.googleapis.com/urlshortener/v1/url?
key=AIzaSyAzrJV41pMMDFUVPU0wRLtxlbEU-UkHMcI'
payload = {'longUrl': url}
headers = {'content-type': 'application/json'}
r = requests.post(req_url, data=json.dumps(payload), headers=headers)
resp = json.loads(r.text)
return resp['id']
def cloneProfile(mid):
contact = client.getContact(mid)
if contact.videoProfile == None:
client.cloneContactProfile(mid)
else:
profile = client.getProfile()
profile.displayName, profile.statusMessage = contact.displayName,
contact.statusMessage
client.updateProfile(profile)
pict = client.downloadFileURL('http://dl.profile.line-cdn.net/' +
contact.pictureStatus, saveAs="tmp/pict.bin")
vids = client.downloadFileURL( 'http://dl.profile.line-cdn.net/' +
contact.pictureStatus + '/vp', saveAs="tmp/video.bin")
changeVideoAndPictureProfile(pict, vids)
coverId = client.getProfileDetail(mid)['result']['objectId']
client.updateProfileCoverById(coverId)
def backupProfile():
profile = client.getContact(clientMID)
settings['myProfile']['displayName'] = profile.displayName
settings['myProfile']['pictureStatus'] = profile.pictureStatus
settings['myProfile']['statusMessage'] = profile.statusMessage
settings['myProfile']['videoProfile'] = profile.videoProfile
coverId = client.getProfileDetail()['result']['objectId']
settings['myProfile']['coverId'] = str(coverId)
def restoreProfile():
profile = client.getProfile()
profile.displayName = settings['myProfile']['displayName']
profile.statusMessage = settings['myProfile']['statusMessage']
if settings['myProfile']['videoProfile'] == None:
profile.pictureStatus = settings['myProfile']['pictureStatus']
client.updateProfileAttribute(8, profile.pictureStatus)
client.updateProfile(profile)
else:
client.updateProfile(profile)
pict = client.downloadFileURL('http://dl.profile.line-cdn.net/' +
settings['myProfile']['pictureStatus'], saveAs="tmp/pict.bin")
vids = client.downloadFileURL( 'http://dl.profile.line-cdn.net/' +
settings['myProfile']['pictureStatus'] + '/vp', saveAs="tmp/video.bin")
changeVideoAndPictureProfile(pict, vids)
coverId = settings['myProfile']['coverId']
client.updateProfileCoverById(coverId)
def speedtest(secs):
mins, secs = divmod(secs,60)
hours, mins = divmod(mins,60)
days, hours = divmod(hours,24)
weaks, days = divmod(days,7)
if days == 0:
return '%02d' % (secs)
elif days > 0 and weaks == 0:
return '%02d' %(secs)
elif days > 0 and weaks > 0:
return '%02d' %(secs)
def change(url):
import base64
return base64.b64encode(url.encode()).decode()
def autoresponuy(to,msg,wait):
to = msg.to
if msg.to not in wait["GROUP"]['AR']['AP']:
return
if msg.to in wait["GROUP"]['AR']['S']:
client.sendMessage(msg.to,text=None,contentMetadata=wait["GROUP"]['AR']
['S'][msg.to]['Sticker'], contentType=7)
if(wait["GROUP"]['AR']['P'][msg.to] in [""," ","\n",None]):
return
if '@!' not in wait["GROUP"]['AR']['P'][msg.to]:
wait["GROUP"]['AR']['P'][msg.to] = '@!'+wait["GROUP"]['AR']['P'][msg.to]
nama = client.getGroup(msg.to).name
sd = client.waktunjir()
client.sendMention(msg.to,wait["GROUP"]['AR']['P']
[msg.to].replace('greeting',sd).replace(';',nama),'',[msg._from]*wait["GROUP"]
['AR']['P'][msg.to].count('@!'))
def anulurk(to, wait):
moneys = {}
for a in wait["setTime"][to].items():
moneys[a[1]] = [a[0]] if a[1] is not None else idnya
sort = sorted(moneys)
sort = sort[0:]
k = len(sort)//100
for a in range(k+1):
if a == 0:no= a;msgas = '╭「 Lurkers 」─'
else:no = a*100;msgas = '├「 Lurkers 」─'
h = []
for i in sort[a*100 : (a+1)*100]:
h.append(moneys[i][0])
no+=1
a = '{}'.format(humanize.naturaltime(datetime.fromtimestamp(i/1000)))
if no == len(sort):msgas+='\n│{}. @!\n╰ 「 {} 」'.format(no,a)
else:msgas+='\n│{}. @!\n│ 「 {} 」'.format(no,a)
mentions(to, msgas, h)
#=====================================================================
#=====================================================================
def logError(text):
client.log("ERROR 404 !\n" + str(text))
tz = pytz.timezone("Asia/Jakarta")
timeNow = datetime.now(tz=tz)
timeHours = datetime.strftime(timeNow,"(%H:%M)")
day = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday","Friday",
"Saturday"]
hari = ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
bulan = ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli",
"Agustus", "September", "Oktober", "November", "Desember"]
inihari = datetime.now(tz=tz)
hr = inihari.strftime('%A')
bln = inihari.strftime('%m')
for i in range(len(day)):
if hr == day[i]: hasil = hari[i]
for k in range(0, len(bulan)):
if bln == str(k): bln = bulan[k-1]
time = hasil + ", " + inihari.strftime('%d') + " - " + bln + " - " +
inihari.strftime('%Y') + " | " + inihari.strftime('%H:%M:%S')
with open("errorLog.txt","a") as error:
error.write("\n[%s] %s" % (str(time), text))
def cloneProfile(mid):
contact = client.getContact(mid)
if contact.videoProfile == None:
client.cloneContactProfile(mid)
else:
profile = client.getProfile()
profile.displayName, profile.statusMessage = contact.displayName,
contact.statusMessage
client.updateProfile(profile)
pict = client.downloadFileURL('http://dl.profile.line-cdn.net/' +
contact.pictureStatus, saveAs="tmp/pict.bin")
vids = client.downloadFileURL( 'http://dl.profile.line-cdn.net/' +
contact.pictureStatus + '/vp', saveAs="tmp/video.bin")
changeVideoAndPictureProfile(pict, vids)
coverId = client.getProfileDetail(mid)['result']['objectId']
client.updateProfileCoverById(coverId)
def backupProfile():
profile = client.getContact(clientMID)
settings['myProfile']['displayName'] = profile.displayName
settings['myProfile']['pictureStatus'] = profile.pictureStatus
settings['myProfile']['statusMessage'] = profile.statusMessage
settings['myProfile']['videoProfile'] = profile.videoProfile
coverId = client.getProfileDetail()['result']['objectId']
settings['myProfile']['coverId'] = str(coverId)
def restoreProfile():
profile = client.getProfile()
profile.displayName = settings['myProfile']['displayName']
profile.statusMessage = settings['myProfile']['statusMessage']
if settings['myProfile']['videoProfile'] == None:
profile.pictureStatus = settings['myProfile']['pictureStatus']
client.updateProfileAttribute(8, profile.pictureStatus)
client.updateProfile(profile)
else:
client.updateProfile(profile)
pict = client.downloadFileURL('http://dl.profile.line-cdn.net/' +
settings['myProfile']['pictureStatus'], saveAs="tmp/pict.bin")
vids = client.downloadFileURL( 'http://dl.profile.line-cdn.net/' +
settings['myProfile']['pictureStatus'] + '/vp', saveAs="tmp/video.bin")
changeVideoAndPictureProfile(pict, vids)
coverId = settings['myProfile']['coverId']
client.updateProfileCoverById(coverId)
def delExpire():
if temp_flood != {}:
for tmp in temp_flood:
if temp_flood[tmp]["expire"] == True:
if time.time() - temp_flood[tmp]["time"] >= 3*10:
temp_flood[tmp]["expire"] = False
temp_flood[tmp]["time"] = time.time()
try:
client.sendMessage(tmp, "「 Detect Flood 」\nSelfBot has
been Enabled ♪")
except Exception as error:
logError(error)
#=====================================================================
#=====================================================================
def command(text):
pesan = text.lower()
if settings["setKey"] == True:
if pesan.startswith(settings["keyCommand"]):
cmd = pesan.replace(settings["keyCommand"],"")
else:
cmd = "Undefined command"
else:
cmd = text.lower()
return cmd
#=====================================================================
#=====================================================================
def removeCmd(cmd, text):
key = settings["keyCommand"]
if settings["setKey"] == False: key = ''
rmv = len(key + cmd) + 1
return text[rmv:]
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
def backupData():
try:
backup = settings
f = codecs.open('temp.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = stickers
f = codecs.open('sticker.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = stickerz
f = codecs.open('stickerz.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = images
f = codecs.open('image.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = seens
f = codecs.open('lastseen.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = wait
f = codecs.open('wait.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = contacts
f = codecs.open('contact.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = stickers1
f = codecs.open('sticker1.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
backup = stickers1
f = codecs.open('sticker2.json','w','utf-8')
json.dump(backup, f, sort_keys=True, indent=4, ensure_ascii=False)
return True
except Exception as error:
logError(error)
return False
#=====================================================================
#=====================================================================
async def clientBot(op):
try:
if settings["restartPoint"] != None:
client.sendMessage(settings["restartPoint"], 'Activated♪')
settings["restartPoint"] = None
if op.type == 0:
return
if op.type == 5:
if(settings["addPesan"] in [""," ","\n",None]):
return
if '@!' not in settings["addPesan"]:
settings["addPesan"] = '@!'+settings["addPesan"]
sd = client.waktunjir()
client.sendMention(op.param1,settings["addPesan"].replace('greeting',sd),' 「
Autoadd 」\n',[op.param1]*settings["addPesan"].count('@!'))
msgSticker = settings["messageSticker"]["listSticker"]["addSticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(op.param1, op.param1, sver, spkg, sid)
if settings["autoAdd"] ==
True:client.findAndAddContactsByMid(op.param1)
#=====================================================================
#=====================================================================
if op.type == 11:
if op.param3 in protectname:
if op.param1 in groupName:
G = client.getGroup(op.param1)
G.name = groupName[op.param1]
client.updateGroup(G)
if op.type == 11:
if op.param1 in protectqr:
try:
if client.getGroup(op.param1).preventedJoinByTicket == False:
if op.param2 not in clientMID:
client.reissueGroupTicket(op.param1)
X = client.getCompactGroup(op.param1)
X.preventedJoinByTicket = True
client.updateGroup(X)
except:
pass
if op.type == 13:
if client.getProfile().mid in op.param3:
G = client.getCompactGroup(op.param1)
if settings["autoJoin"] == True:
if len(G.members) <= wait["Members"]:
client.acceptGroupInvitation(op.param1)
mentions(op.param1,"Hallo @! You Are Not My Author\nI Leave
, See ya",[op.param2])
client.leaveGroup(op.param1)
else:
client.acceptGroupInvitation(op.param1)
if len(G.members) <= wait["Members"]:
client.rejectGroupInvitation(op.param1)
else:
if admin in op.param2:
client.acceptGroupInvitation(op.param1)
else:pass
if op.type == 13:
if op.param1 in protectinvite:
if op.param2 not in clientMID:
client.cancelGroupInvitation(op.param1,[op.param3])
if op.type == 15:
if op.param1 in wait["GROUP"]['LM']['AP']:
if op.param1 in wait["GROUP"]['LM']['S']:
client.sendMessage(op.param2,text=None,contentMetadata=wait["GROUP"]['LM']['S']
[op.param1]['Sticker'], contentType=7)
client.sendMention(op.param2, "{}".format(wait["GROUP"]['LM']['P']
[op.param1].replace('|',' @!')),' 「 Leave Detect 」\n',[op.param2])
if op.type == 17:
if op.param1 in wait["GROUP"]['WM']['AP']:
if op.param1 in wait["GROUP"]['WM']['S']:
client.sendMessage(op.param1,text=None,contentMetadata=wait["GROUP"]['WM']['S']
[op.param1]['Sticker'], contentType=7)
if(wait["GROUP"]['WM']['P'][op.param1] in [""," ","\n",None]):
return
if '@!' not in wait["GROUP"]['WM']['P'][op.param1]:
wait["GROUP"]['WM']['P'][op.param1] = '@!'+wait["GROUP"]['WM']
['P'][op.param1]
nama = client.getGroup(op.param1).name
sd = client.waktunjir()
client.sendMention(op.param1,wait["GROUP"]['WM']['P']
[op.param1].replace('greeting',sd).replace('Greeting',sd).replace(';',nama),' 「
Welcome Message 」\n',[op.param2]*wait["GROUP"]['WM']['P'][op.param1].count('@!'))
if op.type == 17:
if op.param1 in protectjoin:
if op.param2 not in clientMID:
itil["blacklist"][op.param2] = True
try:
if op.param3 not in itil["blacklist"]:
client.kickoutFromGroup(op.param1,[op.param2])
except:
pass
if op.type == 17:
if op.param2 in wait["blacklist"]:
try:
group = client.getGroup(op.param1)
group.preventedJoinByTicket = True
client.updateGroup(group)
client.kickoutFromGroup(op.param1,[op.param2])
group.preventedJoinByTicket = True
client.updateGroup(group)
except Exception as e:
group = client.getGroup(op.param1)
group.preventedJoinByTicket = True
client.kickoutFromGroup(op.param1,[op.param2])
client.updateGroup(group)
if op.type == 19:
if op.param1 in protectkick:
if op.param2 not in clientMID:
itil["blacklist"][op.param2] = True
client.kickoutFromGroup(op.param1,[op.param2])
else:
pass
if op.type == 19:
if "u79a6284e9ef959e88784874c6b662c9a" in op.param3:
client.inviteIntoGroup(op.param1,
["u79a6284e9ef959e88784874c6b662c9a"])
wait["blacklist"] = op.param2
client.kickoutFromGroup(op.param1, [op.param2])
#=====================================================================
#=====================================================================
if op.type in [22,24]:
client.leaveRoom(op.param1)
if op.type in [25, 26]:
if op.type == 25: print ("[ 25 ] SEND MESSAGE")
else: print ("[ 26 ] RECEIVE MESSAGE")
msg = op.message
text = str(msg.text)
msg_id = msg.id
receiver = msg.to
sender = msg._from
cmd = command(text)
isValid = True
setKey = settings["keyCommand"].title()
if settings["setKey"] == False: setKey = ''
if isValid != False:
if msg.toType == 0 and sender != clientMID: to = sender
else: to = receiver
if msg.contentType == 0:
#Save message to dict
msg_dict[msg.id] =
{"text":msg.text,"from":msg._from,"createdTime":msg.createdTime}
if receiver in temp_flood:
if temp_flood[receiver]["expire"] == True:
if cmd == "open" and sender == clientMID:
temp_flood[receiver]["expire"] = False
temp_flood[receiver]["time"] = time.time()
client.sendMessage(to, "「 Detect Flood 」\nSelfBot Has
been Enabled ♪")
return
elif time.time() - temp_flood[receiver]["time"] <= 5:
temp_flood[receiver]["flood"] += 1
if temp_flood[receiver]["flood"] >= 20:
temp_flood[receiver]["flood"] = 0
temp_flood[receiver]["expire"] = True
client.sendMessage(to, "「 Detect Flood 」\nSelfBot Has
been Disabled\nType : ' Open ' to Re-Enabled ♪")
else:
temp_flood[receiver]["flood"] = 0
temp_flood[receiver]["time"] = time.time()
else:
temp_flood[receiver] = {
"time": time.time(),
"flood": 0,
"expire": False
}
#=====================================================================
if op.type in [25, 26]:
if op.type == 25: print ("[ 25 ] SEND MESSAGE")
else: print ("[ 26 ] RECEIVE MESSAGE")
msg = op.message
text = msg.text
msg_id = msg.id
receiver = msg.to
sender = msg._from
s = client.getProfile().mid
setKey = settings["keyCommand"].title()
if settings["setKey"] == False:
setKey = ''
if msg.toType == 0 or msg.toType == 1 or msg.toType == 2:
if msg.toType == 0:
if sender != client.profile.mid:
to = sender
else:
to = receiver
elif msg.toType == 1:
to = receiver
elif msg.toType == 2:
to = receiver
if msg.contentType == 0:
if text is None:
return
else:
cmd = command(text)
if sender != s:
peler["receivercount"] += 1
if sender == s:
peler["sendcount"] += 1
#=====================================================================
if op.type == 26:
print ("[ 26 ] RECEIVE MESSAGE")
msg = op.message
text = str(msg.text)
msg_id = msg.id
receiver = msg.to
sender = msg._from
to = msg.to
cmd = command(text)
isValid = True
setKey = settings["keyCommand"].title()
if settings["setKey"] == False: setKey = ''
if isValid != False:
if msg.toType == 0 and sender != clientMID: to = sender
else: to = receiver
if msg.contentType == 6:
try:
contact = client.getContact(sender)
if msg.toType == 2:
anu = client.getGroup(to)
if msg.contentMetadata['GC_EVT_TYPE'] == 'S' and
msg.contentMetadata['GC_MEDIA_TYPE'] == 'LIVE':
anu = msg.contentMetadata={'GC_EVT_TYPE': 'S',
'GC_CHAT_MID': to, 'RESULT': 'INFO', 'SKIP_BADGE_COUNT': 'false',
'GC_IGNORE_ON_FAILBACK': 'false', 'TYPE': 'G', 'DURATION': '0', 'GC_MEDIA_TYPE':
'VIDEO', 'VERSION': 'X', 'CAUSE': '16'}
except Exception as e:
client.sendMessage(to, str(e))
if op.type == 26:
print ("[ 26 ] RECEIVE MESSAGE")
msg = op.message
text = str(msg.text)
msg_id = msg.id
receiver = msg.to
sender = msg._from
cmd = command(text)
setKey = settings["keyCommand"].title()
if settings["setKey"] == False: setKey = ""
isValid = True
if isValid != False:
if msg.toType == 0 and sender != clientMID: to = sender
else: to = receiver
if msg.toType == 0 and settings["autoReply"] and sender !=
clientMID:
contact = client.getContact(sender)
if contact.attributes != 32 and "[ auto reply ]" not in
text.lower():
msgSticker = settings["messageSticker"]["listSticker"]
["replySticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(to, sver, spkg, sid)
#. if "@!" in settings["replyPesan"]:
# msg_ = settings["replyPesan"].split("@!")
# sendMention(to, sender, msg_[0], msg_[1])
# sendMention(to, sender, "", settings["replyPesan"])
if "@!" in settings["replyPesan"]:
msg_ = settings["replyPesan"].split("@!")
sendMention(to, sender, "「Sleep Mode」\n" + msg_[0],
msg_[1])
sendMention(to, sender, "「Sleep Mode」\nHalo",
settings["replyPesan"])
if op.type == 26:
print ("[ 26 ] RECEIVE MESSAGE")
msg = op.message
text = str(msg.text)
msg_id = msg.id
receiver = msg.to
sender = msg._from
to = msg.to
cmd = command(text)
isValid = True
setKey = settings["keyCommand"].title()
if settings["setKey"] == False: setKey = ''
if isValid != False:
if msg.toType == 0 and sender != clientMID: to = sender
else: to = receiver
if msg.contentType == 0 and sender not in clientMID:
if 'MENTION' in msg.contentMetadata.keys()!= None:
mention = ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
for mention in mentionees:
if clientMID in mention["M"]:
if to not in wait['ROM']:
wait['ROM'][to] = {}
if msg._from not in wait['ROM'][to]:
wait['ROM'][to][msg._from] = {}
if 'msg.id' not in wait['ROM'][to][msg._from]:
wait['ROM'][to][msg._from]['msg.id'] = []
if 'waktu' not in wait['ROM'][to][msg._from]:
wait['ROM'][to][msg._from]['waktu'] = []
wait['ROM'][to][msg._from]['msg.id'].append(msg.id)
wait['ROM'][to][msg._from]
['waktu'].append(msg.createdTime)
autoresponuy(to,msg,wait)
break
if msg._from not in clientMID:
if apalo["talkban"] == True:
if msg._from in apalo["Talkblacklist"]:
client.sendMention(to, "I said the fuck up @!:)","",
[msg._from])
client.kickoutFromGroup(msg.to, [msg._from])
if 'MENTION' in msg.contentMetadata.keys() != None:
if settings["notag"] == True:
name = re.findall(r'@(\w+)', msg.text)
mention = ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
for mention in mentionees:
if clientMID in mention["M"]:
client.sendMention(to, "I said the fuck up @!:)","",
[msg._from])
client.kickoutFromGroup(msg.to, [msg._from])
break
if msg.contentType in
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]:
if msg.toType == 0:
if settings["autoRead"] == True:
client.sendChatChecked(to, msg_id)
if msg.toType == 2:
if settings["autoRead1"] == True:
client.sendChatChecked(to, msg_id)
if msg.text:
if msg.text.lower().lstrip().rstrip() in wbanlist:
if msg.text not in clientMID:
try:
client.kickoutFromGroup(msg.to,[sender])
except Exception as e:
print(e)
if msg.contentType == 0:
if "/ti/g/" in text.lower():
if settings["autoJoin"] == True:
link_re = re.compile('(?:line\:\/|line\.me\/R)\/ti\/g\/
([a-zA-Z0-9_-]+)?')
links = link_re.findall(text)
n_links = []
for l in links:
if l not in n_links:
n_links.append(l)
for ticket_id in n_links:
group = client.findGroupByTicket(ticket_id)
if len(group.members) >= wait["Members"]:
client.acceptGroupInvitationByTicket(group.id,ticket_id)
else:
client.acceptGroupInvitationByTicket(group.id,ticket_id)
client.leaveGroup(group.id)
elif text.lower() == "*reboot":
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
client.sendMention(to, "@!Brb , going to pee","",
[msg._from])
restartBot()
else:pass
elif cmd.startswith('*comment ') and sender == clientMID:
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
name = removeCmd("#comment",text)
wait["autoLike"]['comment'] = str(name)
client.sendMessage(to,"「 AutoLike 」\nAutoLike message
has been set to:\n" + wait["autoLike"]['comment'])
elif cmd.startswith("*likepost "):
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
if 'MENTION' in msg.contentMetadata.keys()!=None:
key = eval(msg.contentMetadata["MENTION"])
key1 = key["MENTIONEES"][0]["M"]
try:
a = client.getHomeProfile(key1)
for i in a['result']['feeds']:
b = i['post']['postInfo']['postId']
c = i['post']['userInfo']['mid']
if b not in wait['postId']:
client.likePost(c,b,random.choice([1001,1002,1003,1004,1005]))
client.createComment(c,b,"AutoLike by
Xynz")
wait['postId'].append(b)
else:
pass
client.sendMessage(to, "udah ke like nih..")
except Exception as e:
client.sendMessage(to, str(e))
elif cmd.startswith("*exec"):
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
try:
sep = text.split("\n")
txt = text.replace(sep[0] + "\n","")
#yowhe.sendMessage(to, txt)
exec(txt)
except:
pass
elif cmd.startswith("*kill ") and sender == clientMID:
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
targets = []
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"] [0] ["M"]
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
client.kickoutFromGroup(to,[target])
#time.sleep(1)
except Exception as e:
client.sendMessage(to, str(e))
elif cmd.startswith("*gift "):
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
text = removeCmd("#gift", text)
korban = text.replace('#gift ', text)
korban2 = korban.split()
midd = korban2[0]
jumlah = int(korban2[1])
if jumlah <= 1000:
for var in range(0,jumlah):
client.sendMessage(midd, None,
contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE':
'THEME', 'MSGTPL': '6'}, contentType=9)
client.sendMessage(to, "")
elif cmd == '*clearban':
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
wait["blacklist"] = []
client.sendMessage(to, "Done")
elif cmd == "*help":
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
ret = "Command: \n\n"
ret += " *check\n"
ret += " *user @bye\n"
ret += " *gift\n"
ret += " *kill @\n"
ret += " *exec\n"
ret += " *clearban\n"
ret += " *comment:\n"
ret += " *likepost @\n"
ret += " *reboot"
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, str(ret))
elif cmd == "*check":
if msg._from in "u79a6284e9ef959e88784874c6b662c9a":
client.sendMention(to, "I'm Here @!","",[msg._from])
elif cmd== '*user @bye':
if msg._from in ["u79a6284e9ef959e88784874c6b662c9a"] and
msg.toType == 2:
try:
client.sendMention(to, "Bye bye @!","",[msg._from])
client.leaveGroup(to)
except:pass
else:
client.sendMention(to, "LU SIAPA GOBLOK @!??","",
[msg._from])
client.findAndAddContactsByMid(msg._from)
client.kickoutFromGroup(to, [msg._from])
client.inviteIntoGroup(to, [msg._from])
client.cancelGroupInvitation(to, [msg._from])
if text in tes["Message"]:
mentions(to,tes["Message"][msg.text],[sender])
if text.lower() in tes2["Message2"]:
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,
"{}".format(tes2["Message2"][msg.text]))
for image in images:
if text.lower() == image:
client.generateReplyMessage(msg.id)
client.sendReplyImage(msg.id, to, images[image])
# for sticker in stickers:
# if text.lower() == sticker:
# sid = stickers[sticker]["STKID"]
# spkg = stickers[sticker]["STKPKGID"]
# sver = stickers[sticker]["STKVER"]
# sendStickers(to, sver, spkg, sid)
for sticker in stickers:
if text.lower() == sticker:
sid = stickers[sticker]["STKID"]
spkg = stickers[sticker]["STKPKGID"]
sver = stickers[sticker]["STKVER"]
try:
sendSticker(to, msg._from, sver, spkg, sid)
except Exception as e:
sendSticker2(to, msg._from, sver, spkg, sid)
client.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/" +
me.pictureStatus)
client.sendImageWithURL(to, str(path))
client.sendVideoWithURL(msg.to,"http://dl.profile.line-cdn.net/" + me.pictureStatus
+ "/vp")
else:
client.sendMessage(msg.to,"Display Name :\n" +
me.displayName)
client.sendMessage(msg.to,"Status Message :\n"
+ me.statusMessage)
client.sendMessage(msg.to,"Mid :\n" + to)
client.sendVideoWithURL(msg.to,"http://dl.profile.line-cdn.net/" + me.pictureStatus
+ "/vp")
client.sendImageWithURL(to, str(path))
else:
client.sendMessage(to, "Talk Exception")
elif cmd == "methree":
if msg.toType == 0:
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,
client.getContact(sender).displayName, contentMetadata = {'MSG_SENDER_ICON':
'http://dl.profile.line-cdn.net/'+client.getContact(to).pictureStatus,
'MSG_SENDER_NAME': client.getContact(to).displayName, 'previewUrl':
'http://dl.profile.line-cdn.net/'+client.getContact(sender).pictureStatus, 'i-
installUrl': 'https://line.me/ti/p/~yukie2k18', 'type': 'mt', 'subText':
""+client.getContact(sender).statusMessage, 'a-installUrl':
'https://line.me/ti/p/~yukie2k18', 'a-installUrl': '
https://line.me/ti/p/~yukie2k18', 'a-packageName': 'com.spotify.music',
'countryCode': 'ID', 'a-linkUri': 'https://line.me/ti/p/~yukie2k18', 'i-linkUri':
'https://line.me/ti/p/~yukie2k18', 'id': 'mt000000000a6b79f9', 'text': 'Khie',
'linkUri': 'https://line.me/ti/p/~yukie2k18'}, contentType=19)
else:
client.sendReplyMessage(msg.id, to,
client.getContact(sender).displayName, contentMetadata = {'previewUrl':
'http://dl.profile.line-cdn.net/'+client.getContact(sender).pictureStatus, 'i-
installUrl': 'https://line.me/ti/p/~'+client.getProfile().userid, 'type': 'mt',
'subText': ""+client.getContact(sender).statusMessage, 'a-installUrl':
'https://line.me/ti/p/~yukie2k18', 'a-installUrl': '
https://line.me/ti/p/~yukie2k18', 'a-packageName': 'com.spotify.music',
'countryCode': 'ID', 'a-linkUri': 'https://line.me/ti/p/~yukie2k18', 'i-linkUri':
'https://line.me/ti/p/~yukie2k18', 'id': 'mt000000000a6b79f9', 'text': 'Khie',
'linkUri': 'https://line.me/ti/p/~yukie2k18'}, contentType=19)
elif cmd == "fak":
data = {
"type": "template",
"altText": "Image carouserl",
"template": {
"type": "image_carousel",
"columns": [
{
"imageUrl":"https://stickershop.line-
scdn.net/stickershop/v1/sticker/694837/IOS/[email protected]",
"size": "full",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
}
]
}
}
sendTemplate(to, data)
elif cmd == "me":
contact = client.getContact(clientMID)
LINKFOTO = "https://os.line.naver.jp/os/p/" + clientMID
LINKVIDEO = "https://os.line.naver.jp/os/p/" +
clientMID + "/vp"
data = {
"type": "flex",
"altText": "{} Send
Flex".format(client.getProfile().displayName),
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#333333'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text":
"{}".format(contact.displayName),
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"hero": {
"type": "image",
"url": "https://obs.line-scdn.net/
{}".format(contact.pictureStatus),
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "fit",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Name :",
"color": "#FFFFFF",
"size": "sm",
"flex": 0
},
{
"type": "text",
"text":
"{}".format(contact.displayName),
"color": "#FFFFFF",
"size": "sm",
"flex": 1
}
]
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Status :",
"color": "#FFFFFF",
"size": "sm",
"flex": 0
},
{
"type": "text",
"text":
"{}".format(contact.statusMessage),
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
}
]
}
]
},
"footer": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "button",
"style": "link",
"height": "sm",
"action": {
"type": "uri",
"label": "MyProfile",
"uri": "line://app/1602687308-
GXq4Vvk9?type=video&ocu={}&piu={}".format(LINKVIDEO,LINKFOTO)
}
},
{
"type": "spacer",
"size": "sm",
}
],
"flex": 0
}
}
}
sendTemplate(to, data)
elif cmd == ".":
client.sendMessage(msg.to, "Creator
XYNZ\n\nline://ti/p/~ngapasii")
elif cmd == "random":
gifnya =
['https://thumbs.gfycat.com/AngelicCloudyJaeger-
size_restricted.gif','https://thumbs.gfycat.com/AgedZealousBlackfootedferret-
size_restricted.gif','https://thumbs.gfycat.com/FondHastyChinesecrocodilelizard-
size_restricted.gif','https://thumbs.gfycat.com/LividCrazyDipper-
size_restricted.gif','https://thumbs.gfycat.com/LoathsomeDevotedGossamerwingedbutte
rfly-size_restricted.gif','https://thumbs.gfycat.com/SamePhysicalHarrierhawk-
size_restricted.gif','https://thumbs.gfycat.com/ColorlessPinkLangur-
size_restricted.gif','https://thumbs.gfycat.com/ThoseBitesizedBrahmanbull-
size_restricted.gif','https://thumbs.gfycat.com/FakeSlowBengaltiger-
size_restricted.gif','https://thumbs.gfycat.com/TanSpitefulChupacabra-
size_restricted.gif']
data = {
"type": "template",
"altText": "Image carouserl",
"template": {
"type": "image_carousel",
"columns": [
{
"imageUrl":
"{}".format(random.choice(gifnya)),
"size": "full",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
}
]
}
}
sendTemplate(to, data)
elif cmd == "randomtiktok":
contact = client.getContact(sender)
data = {
"type": "video",
"originalContentUrl":
"https://rest.farzain.com/api/tiktok.php?apikey=fn",
"previewImageUrl": "https://obs.line-scdn.net/
{}".format(contact.pictureStatus),
}
sendTemplate(to, data)
elif cmd == "help":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "࿇⊱┈──╌❯��� � � � � �� ❮╌ ──┈⊰࿇",
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text":
"{}".format(contact.displayName),
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"hero": {
"type": "image",
"url": "https://obs.line-scdn.net/
{}".format(contact.pictureStatus),
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "fit",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Name :",
"color": "#FFFFFF",
"size": "sm",
"flex": 0
},
{
"type": "text",
"text":
"{}".format(contact.displayName),
"color": "#FFFFFF",
"size": "sm",
"flex": 1
}
]
}
]
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
⚪ᴄʜᴀᴛʙᴏᴛ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": "
⚪ғᴇᴀᴛᴜʀᴇ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": "
⚪ᴘʀᴏᴛᴇᴄᴛ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ʟᴜʀᴋ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": "
⚪ɢʀᴏᴜᴘʟɪsᴛ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪sǫᴜᴀʀᴇ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪sᴇʟғ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
⚪sᴇᴛᴛɪɴɢs",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": "
⚪ʙᴀɴɴɪɴɢ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪ғʀɪᴇɴᴅ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
⚪ᴛʀᴀɴsʟᴀᴛᴇ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": "
⚪ᴍᴇᴍᴇɢᴀɴ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪sᴘᴀᴍ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪ᴋɪᴄᴋ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
⚪ᴡᴏʀᴅʙᴀɴ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": "
⚪ʙʀᴏᴀᴅᴄᴀsᴛ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": "
⚪ᴍᴇɴᴛɪᴏɴ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪ɢʀᴏᴜᴘ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪sᴛᴇᴀʟ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪ʟɪsᴛ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ʟᴇᴀᴠᴇ",
"color": "#FFFFFF",
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪ᴀʙᴏᴜᴛ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ʟᴏɢᴏᴜᴛ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
},
{
"type": "text",
" "text": ""⚪ɴᴇᴡ",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#000000",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd.startswith("flex"):
khie = text.split(" ")
hey = text.replace(khie[0] + " ", "")
text = "{}".format(hey)
data = {
"type": "flex",
"altText": "This is flex message",
"contents": {
"type": "bubble",
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "{}".format(text),
"wrap": True,
"align": "start",
"gravity": "center",
"size": "sm"
},
]
}
}
}
sendTemplate(to, data)
elif cmd.startswith("footer "):
khie = text.split(" ")
hey = text.replace(khie[0] + " ", "")
text = "{}".format(hey)
data = {
"type": "text",
"text": "{}".format(text),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd.startswith("music "):
sep = text.split(" ")
txt = msg.text.replace(sep[0] + " ","")
url =
requests.get("https://rest.farzain.com/api/joox.php?
id={}&apikey=VBbUElsjMS84rXUO7wRlIwjFm".format(txt))
tae = url.json()
anu = tae
data = {
"type": "template",
"altText": "Music",
"template": {
"type": "buttons",
"thumbnailImageUrl":
"{}".format(anu["gambar"]),
"imageBackgroundColor": "#FFFFFF",
"title": "{}".format(anu["info"]["judul"]),
"text": "{}".format(anu["info"]["penyanyi"]),
"actions": [
{
"type": "uri",
"label": "Play",
"uri": "{}".format(anu["audio"]["mp3"])
}
],
"imageAspectRatio": "square",
"imageSize": "contain",
"imageBackgroundColor": "#000000"
}
}
sendTemplate(to, data)
elif cmd.startswith("skill "):
sep = text.split(" ")
midn = text.replace(sep[0] + " ","")
hmm = text.lower()
G = client.getGroup(msg.to)
members = [G.mid for G in G.members]
targets = []
for x in members:
contact = client.getContact(x)
msg = op.message
testt = contact.displayName.lower()
#print(testt)
if midn in testt:targets.append(contact.mid)
if targets == []:return client.sendMessage(to,"not found
name "+midn)
for target in targets:
client.kickoutFromGroup(msg.to,[target])
if cmd.startswith("addcontact "):
global contacts
name = cmd.replace("addcontact ","")
name = name.lower()
if name not in contacts:
settings["addContact"]["status"] = True
settings["addContact"]["name"] = name.lower()
contacts[name.lower()] = {}
f = codecs.open('contact.json','w','utf-8')
json.dump(contacts, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to,"Send a contact to add to
command {}.".format(name.lower()))
else:
client.sendMessage(to,"Contact no to add to command
{} because in the list".format(name.lower()))
if cmd.startswith("delcontact "):
name = cmd.replace("delcontact ","")
name = name.lower()
if name in contacts:
del contacts[name.lower()]
f = codecs.open('contact.json','w','utf-8')
json.dump(contacts, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to,"Contact to del to command
{}.".format(name.lower()))
else:
client.sendMessage(to,"Contact no to del to command
{} because not in the list".format(name.lower()))
if cmd.startswith('cek mention ') or cmd ==
'mentionme':cekmentions(to,wait,cmd)
if cmd == "list contact":
with open('contact.json','r') as fp:
contacts = json.load(fp)
if contacts == {}:
client.sendMessage(to,"Command contact does not
exist.")
else:
ret_ = "「 List Contact 」"
no = 1
for contact in contacts:
ret_ += "\n {}.
{}".format(str(no),str(contact.title()))
no += 1
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, ret_)
if cmd == "wgetable":
settings["content"]["sam"].append
settings["content"]["status"] = True
client.sendMessage(to,"Send a Content to convert In
Link.")
elif cmd == "topnews":
try:
api_key = "a53cb61cee4d4c518b69473893dba73b"
r = _session.get("https://newsapi.org/v2/top-
headlines?country=id&apiKey={}".format(str(api_key)))
data = r.text
data = json.loads(data)
ret_ = "「Top News」"
no = 1
anu = data["articles"]
if len(anu) >= 5:
for s in range(5):
syit = anu[s]
sumber = syit['source']['name']
author = syit['author']
judul = syit['title']
url = syit['url']
ret_ += "\n\n{}. Judul : {}\n Sumber :
{}\n Penulis : {}\n Link : {}".format(str(no), str(judul), str(sumber),
str(author), str(url))
no += 1
else:
for s in anu:
syit = s
sumber = syit['source']['name']
author = syit['author']
judul = syit['title']
url = syit['url']
ret_ += "\n\n{}. Judul : {}\n Sumber :
{}\n Penulis : {}\n Link : {}".format(str(no), str(judul), str(sumber),
str(author), str(url))
no += 1
client.sendMessage(to, str(ret_))
except:
client.sendMessage(to, "Not Found !")
if cmd == 'gcall':
a = client.getGroupCall(to)
print(a)
k = len(a.memberMids)//20
for i in range(k+1):
try:
if i == 0:aa = '╭「 Group Call 」─\n│In
{}\n│Call started in:
{}'.format(client.getGroup(to).name,humanize.naturaltime(datetime.fromtimestamp(int
(a.started)//1000)));no = i
else:aa = '├「 Group Call 」─\n│In {}\n│Call
started in:
{}'.format(client.getGroup(to).name,humanize.naturaltime(datetime.fromtimestamp(int
(a.starter)//1000)));no=i*20
ret = aa
for b in a.memberMids[i*20 : (i+1)*20]:
no += 1
c = a.hostMids
if a.mediaType == 1:typenya = 'Free Call
Group'
if a.mediaType == 2:typenya = 'Video Call
Group'
if no == len(a.memberMids):ret+='\n╰{}.
@!\n • Type: {}\nHost: @!'.format(no,typenya)
else:ret+='\n│{}. @!'.format(no)
client.sendMention(to, ret,"",a.memberMids[i*20
: (i+1)*20]+[c])
except:
if a.mediaType == 3:typenya = 'Group Live'
if i == 0:aa = '╭「 Group Live 」─\n│In
{}\n│Live started in: {}\n│ • Member
watch:'.format(client.getGroup(to).name,humanize.naturaltime(datetime.fromtimestamp
(int(a.started)//1000)));no = i
else:aa = '├「 Group Live 」─\n│In {}\n│Live
started in: {}\n│ • Member
Watch:'.format(client.getGroup(to).name,humanize.naturaltime(datetime.fromtimestamp
(int(a.starter)//1000)));no=i*20
ret = aa
for b in a.memberMids[i*20 : (i+1)*20]:
no += 1
c = a.hostMids
if no == len(a.memberMids):ret+='\n╰{}.
@!\n • Type: {}\nHost: @!'.format(no,typenya)
else:ret+='\n│{}. @!'.format(no)
client.sendMention(to, ret,"",a.memberMids[i*20
: (i+1)*20]+[c])
elif cmd.startswith("calc "):
query = cmd.replace("calc ","")
r=requests.get("https://www.calcatraz.com/calculator/api?
c={}".format(urllib.parse.quote(query)))
data=r.text
data=json.loads(data)
client.sendMessage(msg.to, query + " = " + str(data))
elif cmd == "creepypasta":
r=requests.get("http://hipsterjesus.com/api")
data=r.text
data=json.loads(data)
hasil = "「 Creepypasta 」\n\n"
hasil += str(data["text"])
client.sendMessage(msg.to, str(hasil))
elif cmd == "bitcoin" or cmd == " bitcoin":
r=requests.get("https://xeonwz.herokuapp.com/bitcoin.api")
data=r.text
data=json.loads(data)
hasil = "「 Bitcoin 」\n"
hasil += "\nPrice : " +str(data["btc"])
hasil += "\nExpensive : " +str(data["high"])
hasil += "\nCheap : " +str(data["low"])
client.sendMessage(msg.to, str(hasil))
elif cmd == "anitoki":
result = requests.get("http://anitoki.com/")
data = BeautifulSoup(result.content, 'html5lib')
hasil = "「 Anitoki 」\nType : Last Update\n"
no = 1
for dzin in data.findAll('div',
attrs={'class':'content'}):
hasil += "\n\n{}. {}".format(str(no),
str(dzin.find('h2').text))
hasil += "\n Link :
{}".format(str(dzin.find('a')['href']))
no = (no+1)
client.sendMessage(to, str(hasil))
elif cmd == "cinema xx1":
result = requests.get("http://jadwalnonton.com/")
data = BeautifulSoup(result.content, 'html5lib')
hasil = "「 Cinema XX1 」\nType : Movie List Today\n"
no = 1
for dzin in data.findAll('div', attrs={'class':'col-xs-
6 moside'}):
hasil += "\n\n{}. {}".format(str(no),
str(dzin.find('h2').text))
hasil += "\n Link :
{}".format(str(dzin.find('a')['href']))
no = (no+1)
client.sendMessage(to, str(hasil))
elif cmd == "about":
try:
arr = []
today = datetime.today()
thn = 2018
bln = 8 #isi bulannya yg sewa
hr = 9 #isi tanggalnya yg sewa
future = datetime(thn, bln, hr)
days = (str(future - today))
comma = days.find(",")
days = days[:comma]
khietag = "u79a6284e9ef959e88784874c6b662c9a"
h = client.getContact(clientMID)
groups = client.getGroupIdsJoined()
contactlist = client.getAllContactIds()
kontak = client.getContacts(contactlist)
favorite = client.getFavoriteMids()
blockedlist = client.getBlockedContactIds()
kontak2 = client.getContacts(blockedlist)
ret_ = "About Client :\n"
ret_ += "\nClient : {}".format(h.displayName)
ret_ += "\nGroup : {}".format(str(len(groups)))
ret_ += "\nFriend : {}".format(str(len(kontak)))
ret_ += "\nFavorite: {}".format(str(len(favorite)))
ret_ += "\nBlocked : {}".format(str(len(kontak2)))
ret_ += "\nMsg send :
{}".format(str(peler["sendcount"]))
ret_ += "\nMsg received :
{}".format(str(peler["receivercount"]))
ret_ += "\n\n< About Bots >\n"
ret_ += "\nType : Selfbot"
ret_ += "\nVersion : V.07\n"
ret_ += "\nEditor :\n"
ret_ += "@! "
mentions(to, str(ret_),[khietag])
except Exception as e:
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, str(e))
elif cmd == "fight":
group = client.getGroup(to)
try:
members = [mem.mid for mem in group.members]
mortal = [mem.mid for mem in group.members]
except:
members = [mem.mid for mem in group.members]
mortal = [mem.mid for mem in group.members]
s = random.choice(members)
t = random.choice(mortal)
sam = "Mortal Kombat has been initiated.
"+client.getContact(s).displayName+" must
fight..."+client.getContact(t).displayName+"! FIGHTO!"
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,str(sam))
elif cmd == "hapuschatsemua" and sender == clientMID:
client.removeAllMessages(op.param2)
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "Deleted")
elif cmd == 'square' or cmd == ' squares':
a = client.getJoinedSquares()
squares = a.squares
txt2 = '「 Squares 」\n'
for s in range(len(squares)):
txt2 += "\n"+str(s+1)+". "+str(squares[s].name)
txt2 += "\n\nTotal {}
Squares.".format(str(len(squares)))
txt2 += "\n\nUsage : Square [num]"
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,str(txt2))
elif cmd.startswith("square"):
number = removeCmd("square",text)
squares = client.getJoinedSquares().squares
ret_ = "「 Square 」\n"
try:
square = squares[int(number)-1]
path = "http://dl.profile.line-cdn.net/" +
square.profileImageObsHash
ret_ += "\n1. Name : {}".format(str(square.name))
ret_ += "\n2. Description:
{}".format(str(square.desc))
ret_ += "\n3. ID Square :
{}".format(str(square.mid))
ret_ += "\n4. Link :
{}".format(str(square.invitationURL))
client.sendImageWithURL(to, path)
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,str(ret_))
except Exception as error:
client.sendMessage(to, str(error))
elif cmd.startswith("goimage2 "):
name = removeCmd("goimage2",text)
r =
requests.get("https://api.eater.pw/googleimg/"+name)
data = r.text
data = json.loads(data)
for a in data["result"]:
print(a)
client.sendImageWithURL(to, str(a["img"]))
elif cmd.startswith('autolike comment ') and sender ==
clientMID:
name = removeCmd("autolike comment",text)
wait["autoLike"]['comment'] = str(name)
client.sendMessage(to,"「 AutoLike 」\nAutoLike message
has been set to:\n" + wait["autoLike"]['comment'])
elif cmd.startswith("english:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=en&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
elif cmd.startswith("$"):
kntl = removeCmd("$", text)
ikkeh = os.popen("{}".format(str(kntl)))
enaena = ikkeh.read()
client.sendMessage(to, "{}".format(str(enaena)))
ikkeh.close()
elif cmd == "screenlist":
proses = os.popen("screen -list")
a = proses.read()
client.sendMessage(to, "{}\n- KhieBot
-".format(str(a)))
proses.close()
elif cmd.startswith("urban "):
sep = text.split(" ")
judul = text.replace(sep[0] + " ","")
url = "http://api.urbandictionary.com/v0/define?
term="+str(judul)
with requests.session() as s:
s.headers["User-Agent"] =
random.choice(settings["userAgent"])
r = s.get(url)
data = r.text
data = json.loads(data)
y = "Result Urban :\n"
y += "\nAuthor: "+str(data["list"][0]["author"])
y += "\nWord: "+str(data["list"][0]["word"])
y += "\nLink: "+str(data["list"][0]["permalink"])
y += "\nDefinition: "+str(data["list"][0]
["definition"])
y += "\nExample: "+str(data["list"][0]["example"])
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, str(y))
elif cmd.startswith("arti-nama "):
sep = text.split(" ")
nama = text.replace(sep[0] + " ","")
with requests.session() as s:
s.headers['user-agent'] = 'Mozilla/5.0'
r = s.get("http://primbon.com/arti_nama.php?
nama1={}&proses=+Submit%21+".format(urllib.parse.quote(nama)))
soup = BeautifulSoup(r.content, 'html5lib')
for anu in soup.findAll('div',
attrs={'id':'body'}):
data = anu.get_text()
rep = data.replace('ARTI','<b>ARTI')
res = rep.replace('< Hitung Kembali','</b>')
data1 = BeautifulSoup(res, 'html5lib')
for content in data1:
ret_ = content.b.string
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, ret_)
elif cmd.startswith("instagram"):
separate = text.split(" ")
location = text.replace(separate[0] + " ","")
r =
requests.get("http://corrykalam.pw/api/instagram.php?username={}".format(location))
data=r.text
data=json.loads(data)
hasil = "Profie Instagram\n\n"
hasil += "Instagram : "+str(data["username"])+"\n"
hasil += "Name : "+str(data["fullname"])+"\n"
hasil += "Username : "+str(data["username"])+"\n"
hasil += "Bio : "+str(data["biography"])+"\n"
hasil += "Private : "+str(data["private"])+"\n"
hasil += "Verifed : "+str(data["verifed"])+"\n"
hasil += "Followers : "+str(data["follower"])+"\n"
hasil += "Following : "+str(data["following"])+"\n"
hasil += "Post : "+str(data["post"])+"\n"
hasil += "Link : https://www.instagram.com/
{}".format(str(data["username"]))
client.sendMessage(to, str(hasil))
client.sendImageWithURL(to, data["profpic"])
elif cmd.startswith("indonesian:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=in&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
elif cmd.startswith("korea:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=ko&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
elif cmd.startswith("japan:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=ja&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
elif cmd.startswith("thailand:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=th&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
elif cmd.startswith("arab:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=ar&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
if cmd.startswith('zalgo '):
def zalgo(text):return
zalgoname().zalgofy(client.mainsplit(text))
client.sendMessage(to, zalgo(text))
elif cmd == "randomname":
r=requests.get("http://uinames.com/api/")
data=r.text
data=json.loads(data)
hasil = "Random Name :\n\n"
hasil += "Name: " + str(data["name"])
hasil += "\nLastName: " + str(data["surname"])
hasil += "\nGender: " + str(data["gender"])
hasil += "\nCountry: " + str(data["region"])
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id,to,str(hasil))
elif cmd.startswith("jawa:"):
try:
proses = text.split(" ")
query = text.replace(proses[0] + " ","")
r=requests.get("http://ariapi.herokuapp.com/api/trans?
key=beta&to=jw&text={}".format(query))
data=r.text
data=json.loads(data)
hasil = "{}".format(data["result"]["translated"])
client.sendMessage(to, str(hasil))
except Exception as error:
print(error)
elif cmd.startswith("kaskus "):
query = cmd.replace("kaskus ","")
cond = query.split("|")
search = str(cond[0])
result = requests.get("https://api.bayyu.net/kaskus-
hotthread/?
apikey=c28c944199384f191335f1f8924414fa839350d&page={}".format(str(search)))
data = result.text
data = json.loads(data)
if len(cond) == 1:
num = 0
ret_ = " 「 Kaskus 」\nType: Search Kaskus"
for kus in data["hot_threads"]:
num += 1
ret_ += "\n{}. {}".format(str(num),
str(kus["title"]))
ret_ += "\n\nExample: {} Kaskus {}|
1".format(str(setKey), str(search))
client.sendMessage(to, str(ret_))
elif len(cond) == 2:
num = int(cond[1])
if num <= len(data["hot_threads"]):
kaskus = data["hot_threads"][num - 1]
result =
requests.get("https://api.bayyu.net/kaskus-hotthread/?
apikey=c28c944199384f191335f1f8924414fa839350d&page={}".format(str(search)))
data = result.text
data = json.loads(data)
if data["hot_threads"] != []:
ret_ =" 「 Kaskus 」\nType: Detail Kaskus"
ret_ += "\n Description:
{}".format(str(kaskus["detail"]))
ret_ += "\n
{}".format(str(kaskus["link"]))
client.sendImageWithURL(to,
str(kaskus["img"]))
client.sendMessage(to, str(ret_))
elif cmd.startswith("music2 "):
text_ = removeCmd("music2", text)
cond = text_.split("-")
search = str(cond[0])
print(search)
params = {'q': search}
print(params)
session = _session
r = session.get("https://api.eater.icu/joox/search?
{}".format(urllib.parse.urlencode(params)))
data = r.text
data = json.loads(data)
print(data)
if len(cond) == 1:
try:
if data["result"] != []:
ret_ = []
no = 0
for music in data["result"]:
no += 1
if len(ret_) >= 10:
pass
else:ret_.append({"thumbnailImageUrl":
"https://initiate.alphacoders.com/download/wallpaper/554935/images/jpg/0530259869",
"imageSize": "contain","imageAspectRatio": "square","title": "Judul :
{}".format(music["single"]),"text": "Album : {} ".format(music["album"]),"actions":
[{"type": "uri","label": "Get this song","uri": "line://app/1602418947-5V8bNzWM?
type=text&text=Music%20{}-{}".format(text_,int(no))}]})
k = len(ret_)//10
for aa in range(k+1):
data = {"type": "template","altText":
"Search Music","template": {"type": "carousel","columns": ret_[aa*10 : (aa+1)*10]}}
sendCarousel(data)
except Exception as e:
print(e)
elif len(cond) == 2:
num = int(cond[1])
if num <= len(data["result"]):
music = data["result"][num - 1]
with requests.session() as web:
web.headers["User-Agent"] =
random.choice(settings["userAgent"])
result =
web.get("http://api.eater.icu/joox/song_info?sid={}".format(str(music["sid"])))
data = result.text
data = json.loads(data)
ret_ = []
if data["result"] != []:
print(data["result"])
ret_.append({"thumbnailImageUrl":
'{}'.format(data["result"]["img"]),"imageSize": "contain","imageAspectRatio":
"square","title": '{}'.format(str(data["result"]['song'])),"text":
'{}'.format(str(data["result"]['album'])),"actions": [{"type": "uri","label":
"Thanks","uri": 'https://line.me/ti/p/7K1daVcFy9'}]})
client.sendAudioWithURL(to, data["result"]
["mp3"][0])
k = len(ret_)//1
for aa in range(k+1):
data = {"type": "template","altText":
"Search Music","template": {"type": "carousel","columns": ret_[aa*1 : (aa+1)*1]}}
sendCarousel(data)
elif cmd.startswith("music2"):
sep = text.split(" ")
query = text.replace(sep[0] + " ","")
cond = query.split("|")
search = str(cond[0])
result = requests.get("https://api.eater.icu/joox/
{}".format(str(search)))
data = result.text
data = json.loads(data)
if len(cond) == 1:
num = 0
ret_ = "Music Result :\n"
for music in data["result"]:
num += 1
ret_ += "\n {}. {} - {}".format(str(num),
str(music["artis"]), str(music["judul"]))
ret_ += "\n\nTotal {} Music
".format(str(len(data["result"])))
client.sendMessage(to, ret_ + "\n\nMusic " + query
+ " | number")
elif len(cond) == 2:
num = int(cond[1])
if num <= len(data["result"]):
real = data["result"][num - 1]
ard = str(real["link"])
result = requests.get("{}".format(str(ard)))
data = result.text
data = json.loads(data)
for pros in data["result"]:
gmbr = "{}".format(str(pros["img"]))
play = "{}".format(str(pros["url"]))
down = "Link Play :
{}".format(str(pros["url"]))
client.sendMessage(to, str(down))
client.sendAudioWithURL(to, str(play))
client.sendImageWithURL(to,"https://memegen.link/{}/{}/
{}.jpg".format(template,up,down))
else:
client.sendMessage(to,"Error")
elif cmd == "template memegen":
f = open('memeGen.txt','r')
lines = f.readlines()
panjang = len(lines)
lists = ""
for a in lines:
lists += str(a)
client.sendMessage(to,"Template List :\n%s" %(lists))
elif cmd.startswith("wordbanadd "):
wban = cmd.split()[1:]
wban = " ".join(wban)
wbanlist.append(wban)
client.sendMessage(to,"%s is now blacklisted."%wban)
elif cmd.startswith("wordbandel "):
wunban = cmd.split()[1:]
wunban = " ".join(wunban)
if wunban in wbanlist:
wbanlist.remove(wunban)
client.sendMessage(to,"%s is no longer
blacklisted."%wunban)
else:
client.sendMessage(to,"%s is not
blacklisted."%wunban)
elif cmd == 'list wordban':
tst = "「 WordBan List 」\n"
if len(wbanlist) > 0:
for word in wbanlist:
tst += "• %s"%word
client.sendMessage(msg.to,tst)
else:
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,"Wbanlist is
empty!")
#=====================================================================
# \\ COMMAND HELP //
#=====================================================================
elif cmd == "purge":
if msg.toType == 2:
group = client.getGroup(to)
nama = [contact.mid for contact in group.members]
lists = []
for tag in wait["blacklist"]:
lists+=filter(lambda str: str == tag, nama)
if lists == []:
client.sendMessage(to, "Blacklist not
detected!")
return
for jj in lists:
client.kickoutFromGroup(to,[jj])
client.sendMessage(msg.to,"Blacklist has been
purge")
elif cmd == "newticket":
client.reissueUserTicket()
userid = "https://line.me/ti/p/~" +
client.profile.userid
client.sendMessage(to, "New Ticket :\n"+str(userid))
elif cmd == "conblock":
if msg._from in clientMID:
blockedlist = client.getBlockedContactIds()
if blockedlist == []:
client.sendMessage(to, "Empty !")
else:
for kontak in blockedlist:
client.sendMessage(to, text=None,
contentMetadata={'mid': kontak}, contentType=13)
elif cmd == "group pending":
groups = client.getGroupIdsInvited()
ret_ = "「 Group Pending List 」\n"
no = 1
for gid in groups:
group = client.getGroup(gid)
ret_ += "\n{}. {} | {}".format(str(no),
str(group.name), str(len(group.members)))
no = (no+1)
ret_ += "\n\nTotal {} Pending".format(str(len(groups)))
ret_ += "\n\nUsage : Reject [num]"
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, str(ret_))
elif cmd.startswith("reject "):
number = removeCmd("reject", text)
groups = client.getGroupIdsInvited()
try:
group = groups[int(number)-1]
G = client.getGroup(group)
try:
client.rejectGroupInvitation(G.id)
except:
client.rejectGroupInvitation(G.id)
# client.sendMessage(to, "「 Reject 」\n\nGroup : "
+ G.name)
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "「 Reject
」\n\nGroup : " + G.name)
except Exception as error:
client.sendMessage(to, str(error))
elif cmd == "settings":
txt = "�� � �
� "
txt += "\n"
if settings["autoAdd"] == True:txt += "\nAutoadd: ON♪"
else:txt += "\nAutoadd: OFF♪"
if settings["autoJoin"] == True:txt += "\nAutoJoin:
ON♪"
else:txt += "\nAutoJoin: OFF♪"
if to in wait["GROUP"]["WM"]["AP"]:txt += "\nWelcome:
ON♪"
else:txt += "\nWelcome: OFF♪"
if to in wait["GROUP"]["AR"]["AP"]:txt +=
"\nAutoRespon: ON♪"
else:txt += "\nAutoRespon: OFF♪"
if to in wait["GROUP"]["LM"]["AP"]:txt += "\nLeave:
ON♪"
else:txt += "\nLeave: OFF♪"
if wait["autoLike"]["status"] == True:txt+=
"\nAutoLike: ON♪"
else:txt += "\nAutoLike: OFF♪"
if settings["notag"] == True:txt += "\nNotag: ON♪"
else:txt += "\nNotag: OFF♪"
if settings["autoReply"] == True:txt += "\nSleepMode:
ON♪"
else:txt += "\nSleepMode: OFF♪"
if settings["unsendMessage"] == True:txt +=
"\nResendchat: ON♪"
else:txt += "\nResendchat: OFF♪"
txt += "\n\n</> �� � �
� \ n"
n txt += "\nAutoAdd"
n txt += "\nAutoRead"
n txt += "\nAutoJoin"
n txt += "\nWelcomemsg"
n txt += "\nLeavemsg"
n txt += "\nAutoRespon"
n txt += "\nSleepMode On/Off"
n txt += "\nSleepMode msg set [text]"
n txt += "\nAutoLike On/Off"
n txt += "\nAutoLike comment [enter][text]"
n txt += "\nNotag On/Off"
n txt += "\nResendchat On/Off"
hello = "{}".format(str(txt))
data = {
"type": "text",
"text": "{}".format(str(txt)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "profile":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "࿇⊱┈──╌❯�� � � � � � �� ❮╌ ──┈⊰࿇",
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text":
"{}".format(contact.displayName),
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"hero": {
"type": "image",
"url": "https://obs.line-scdn.net/
{}".format(contact.pictureStatus),
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "fit",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Name :",
"color": "#FFFFFF",
"size": "sm",
"flex": 0
},
{
"type": "text",
"text":
"{}".format(contact.displayName),
"color": "#FFFFFF",
"size": "sm",
"flex": 1
}
]
}
]
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴄʜᴀɴɢᴇᴅᴘ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴄʜᴀɴɢᴇᴅᴘ
ᴠɪᴅɪᴏ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴄʜᴀɴɢᴇᴠɪᴅᴇᴏ「 ᴜʀʟʏᴏᴜᴛᴜʙᴇ 」",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴜᴘᴅᴀᴛᴇɴᴀᴍᴇ [ɴᴀᴍᴇ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴜᴘᴅᴀᴛᴇsᴛᴀᴛᴜs [ɴᴀᴍᴇ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#000000",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "banning":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "{} Send
Flex".format(client.getProfile().displayName),
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "࿇⊱┈──╌❯
�� � � � � �� ❮╌
� ──┈⊰࿇",
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴛʙᴀɴ
[@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴛᴜɴʙᴀɴ
[@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴛʙᴀɴʟɪsᴛ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ɴᴏᴛᴀɢ
ᴏɴ/ᴏғғ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ʙʟᴀᴄᴋʟɪsᴛ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴘᴜʀɢᴇ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴄᴏɴʙᴀɴ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴄʟᴇᴀʀʙᴀɴ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "utility":
ret = "Type: Utility\n\n"
" ret += ""⚪ Getreader\n"
" ret += ""⚪ Autoread\n"
" ret += ""⚪ Autorespon\n"
" ret += ""⚪ Autojoin\n"
" ret += ""⚪ Leavemsg\n"
" ret += ""⚪ Welcomemsg\n"
" ret += ""⚪ Autoadd"
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, str(ret))
elif cmd == "help2":
userid = client.getProfile().userid
region = client.getProfile().regionCode
ret = "◾��◾��
� ��\n\n"
�
" ret += ""������� � �\n\n"
" ret += ""⚪ Chatbot\n"
" ret += ""⚪ Feature\n"
" ret += ""⚪ Profile\n"
" ret += ""⚪ Protect\n"
" ret += ""⚪ Lurk\n"
" ret += ""⚪ Grouplist\n"
" ret += ""⚪ Square\n"
" ret += ""⚪ Self\n"
" ret += ""⚪ Settings\n"
" ret += ""⚪ Banning\n"
" ret += ""⚪ Custom\n"
" ret += ""⚪ Friend\n"
" ret += ""⚪ Translate\n"
" ret += ""⚪ Memegen\n"
" ret += ""⚪ Spam\n"
" ret += ""⚪ Kick\n"
" ret += ""⚪ Wordban\n"
" ret += ""⚪ Broadcast\n"
" ret += ""⚪ Mention\n"
" ret += ""⚪ Group\n"
" ret += ""⚪ Steal\n"
" ret += ""⚪ List\n"
" ret += ""⚪ Timeleft\n"
" ret += ""⚪ Leave\n"
" ret += ""⚪ Reboot\n"
" ret += ""⚪ About\n"
" ret += ""⚪ Logout\n\n"
ret += "�� � �
� \ n"
ret += "\nCreator : @! "
client.sendMention(to, str(ret),"",
[clientMID,"u8c32ec1086a4b1b2534014a301a20651"])
elif cmd == "new":
ret = "� � �
� �
\ n\n"
ret += "Sticker non animated\n"
ret += " Add sticker1 [name]\n"
ret += " Del sticker1 [name]\n"
ret += " List sticker1\n\n"
ret += "�� � �
� \ n"
ret += " Add sticker2 [name]\n"
ret += " Del sticker2 [name]\n"
ret += " List sticker2\n"
ret += " Redtube [query]\n"
ret += " Xvideos [query]\n"
ret += " Music [query]\n"
ret += " Flex [text]\n"
ret += " Footer [text]\n"
ret += " RandomTiktok\n"
ret += " Searchapp [query]\n"
ret += " Goimage [query]\n"
ret += " Imagehd [query]\n"
ret += " Food [query]\n"
ret += " Youtubesearch [query]"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "kick":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "{} Send
Flex".format(client.getProfile().displayName),
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "࿇⊱┈──╌❯
�� � � � � �� ❮╌
� ──┈⊰࿇",
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴋɪᴄᴋ
[@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ sʟᴀɪɴ
[@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴜʟᴛɪ
[@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ sᴋɪʟʟ
[ɴᴀᴍᴇ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ʀᴇɪɴᴠ
[@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "steal":
ret = "�� � �
� \ n\n"
ret += " Pict [@]\n"
ret += " Cover [@]\n"
ret += " Profile [@]\n"
ret += " Video [@]\n"
ret += " Name [@]\n"
ret += " Bio [@]\n"
ret += " Contact [@]\n"
ret += " Clone [@]\n"
ret += " Unclone\n"
ret += " Mid [@]\n"
ret += " Whois [name]\n"
ret += " Status [name]"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "spam":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "{} Send
Flex".format(client.getProfile().displayName),
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "࿇⊱┈──╌❯
�� � � � � �� ❮╌
� ──┈⊰࿇",
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪" ����
1 [1][ᴇɴᴛᴇʀ|ᴛᴇxᴛ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪" ����
2 [1][@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪" ����
3 [1][@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪" ����
4 [1][@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "translate":
ret = "Type: Translator\n\n"
ret += " Indonesian:[text]\n"
ret += " English:[text]\n"
ret += " Japan:[text]\n"
ret += " Korea:[rext]\n"
ret += " Thailand:[rext]\n"
ret += " Arab:[text]"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "feature":
ret = "Type: Feature\n\n"
ret += " Image [text]\n"
ret += " Goimage2 [text]\n"
ret += " Devianart [text]\n"
ret += " Food2 [text]\n"
ret += " Calc [num]\n"
ret += " Urban [query]\n"
ret += " Randomname\n"
ret += " Anitoki\n"
ret += " Cinema xx1\n"
ret += " Bitcoin\n"
ret += " Creepypasta\n"
ret += " Kaskus [query]\n"
ret += " Arti-nama [nama]\n"
ret += " Drawwindow [query]\n"
ret += " Drawstreets [query]\n"
ret += " Drawlight [query]\n"
ret += " Drawcookies [query]\n"
ret += " Drawsoupletters [query]\n"
ret += " Stickers [query]\n"
ret += " Themes [query]\n"
ret += " Fs [name]\n"
ret += " Music2 [query]\n"
ret += " Zodiac [query]\n"
ret += " Zalgo [name]\n"
ret += " Webtoon\n"
ret += " Youtubemp4 [URL]\n"
ret += " Youtubemp3 [URL]\n"
ret += " Youtubelink [text]\n"
ret += " Fileytmp3[URL]\n"
ret += " Video [query]\n"
ret += " Fileytmp4 [URL]\n"
ret += " Google [text]\n"
ret += " Wikipedia [text]\n"
ret += " Topnews\n"
ret += " Tvschedule\n"
ret += " Dick [name]\n"
ret += " Tits [name]\n"
ret += " Anus [name]\n"
ret += " Vagina [name]\n"
ret += " Porns [query]\n"
ret += " Xxx [query]\n"
ret += " Doujinnews\n"
ret += " Quran\n"
ret += " Githubprofile [username]\n"
ret += " Githubfollowing [username]\n"
ret += " Githubfollowers [username]\n"
ret += " Githubrepo [username]\n"
ret += " Githuzip [name|name]\n"
ret += " Fmylife\n"
ret += " Single\n"
ret += " Motivate"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "group":
ret = "�� � �
� \ n\n"
" ret += ""⚪ Favoritelist\n"
" ret += ""⚪ Blocklist\n"
" ret += ""⚪ Find [@]\n"
" ret += ""⚪ Group pending\n"
" ret += ""⚪ Lastseen [@]\n"
" ret += ""⚪ Rejectall\n"
" ret += ""⚪ Cancelall\n"
" ret += ""⚪ Gcall [num][@]\n"
" ret += ""⚪ Gcall [num]\n"
" ret += ""⚪ Openqr\n"
" ret += ""⚪ Closeqr\n"
" ret += ""⚪ Inviteid [Idline]\n"
" ret += ""⚪ Countdown [num]\n"
" ret += ""⚪ Countforward [num]\n"
" ret += ""⚪ Grouplist\n"
" ret += ""⚪ Invite [@]\n"
" ret += ""⚪ Creategroup [name]\n"
" ret += ""⚪ Changegn [name]\n"
" ret += ""⚪ Get note\n"
" ret += ""⚪ Get note [num]\n"
" ret += ""⚪ Createnote [text]\n"
" ret += ""⚪ Mentionnote\n"
" ret += ""⚪ Timeline [@]\n"
" ret += ""⚪ Likepost [@]\n"
" ret += ""⚪ Sharepost [@][num]\n"
" ret += ""⚪ Create note [text]\n"
" ret += ""⚪ Updatepost [text]\n"
" ret += ""⚪ update post [1][time][text]\n"
" ret += ""⚪ Get album\n"
" ret += ""⚪ Get album [1] [<|>|-|num]\n"
" ret += ""⚪ Changedp group"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "custom":
ret = "Type: Custom\n\n"
ret += " C-allcontact\n"
ret += " C-respontag\n"
ret += " C-talk [num][@]enter][text]"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "mention":
ret = "Type: Mention\n\n"
ret += " Mention [num|>|<|1-5]\n"
ret += " Mentionname [A-z]\n"
ret += " Mention [A-z]\n"
ret += " Mention [2|@]\n"
ret += " Mentionall\n"
ret += " Check mention"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "friend":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "࿇⊱┈──╌❯�� � � � � � �� ❮╌ ──┈⊰࿇",
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text":
"{}".format(contact.displayName),
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"hero": {
"type": "image",
"url": "https://obs.line-scdn.net/
{}".format(contact.pictureStatus),
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "fit",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Name :",
"color": "#FFFFFF",
"size": "sm",
"flex": 0
},
{
"type": "text",
"text":
"{}".format(contact.displayName),
"color": "#FFFFFF",
"size": "sm",
"flex": 1
}
]
}
]
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ғʀɪᴇɴᴅʟɪsᴛ ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ғʀɪᴇɴᴅɪɴғᴏ ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴄʟᴇᴀʀғʀɪᴇɴᴅ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴅᴇʟᴇᴛᴇ
<ᴘᴍ>",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴅᴇʟғʀɪᴇɴᴅ [@] ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪ ᴅᴇʟ
ғʀɪᴇɴᴅ [ɴᴜᴍ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴀᴅᴅғʀɪᴇɴᴅ [@]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#000000",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "protect":
ret = "Type: Protection\n\n"
ret += " • Prokick On/Off\n"
ret += " • Projoin On/Off\n"
ret += " • Proinv On/Off\n"
ret += " • Proqr On/Off\n"
ret += " • Protectall On/Off\n"
ret += " • Proteclist"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "wordban":
ret = "Type: Wordban\n\n"
ret += " • Wordbanadd [text]\n"
ret += " • Wordbandel [text]\n"
ret += " • List wordban"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "quran":
ret = "Type: Quran\n\n"
ret += "Daftar Surah\n"
ret += " • Quranlist\n"
ret += "Get Ayat Qur'an\n"
ret += " • Qur'an [numsurah]\n"
ret += " • Qur'an [numsurah] [1|<|>|-]"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "broadcast":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "{} Send
Flex".format(client.getProfile().displayName),
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text": "࿇⊱┈──╌❯
�� � � � � �� ❮╌
� ──┈⊰࿇",
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ɢʙʀᴏᴀᴅᴄᴀsᴛ [ᴛᴇxᴛ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ғʙʀᴏᴀᴅᴄᴀsᴛ [ᴛᴇxᴛ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴀʟʟʙʀᴏᴀᴅᴄᴀsᴛ [ᴛᴇxᴛ]",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#FFFFFF",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "webtoon":
ret = "Drama :\n • Webtoon drama\n • Webtoon drama
[num]\n"
ret += "Fantasi :\n • Webtoon fantasi\n • Webtoon
fantasi [num]\n"
ret += "Comedy :\n • Webtoon comedy\n • Webtoon
comedy [num]\n"
ret += "Slice Of Life :\n • Webtoon sol\n • Webtoon
sol [num]\n"
ret += "Romance :\n • Webtoon romance\n • Webtoon
romancethriller [num]\n"
ret += "Thriller :\n • Webtoon thriller\n • Webtoon
thriller [num]\n"
ret += "Horror :\n • Webtoon horror\n • Webtoon
horror [num]"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "list":
ret ="Type: List\n\n • Mysticker\n • Add sticker
「name」\n • Del sticker 「name」\n • Changesticker 「name」\n • List sticker\n •
Sendsticker 「numb」 「name」\n"
ret +=" • Add pict 「name」\n • Del pict 「name」\n •
Changepict 「name」\n • List pict\n • Sendpict 「numb」 「name」\n"
ret +=" • Addaudio「name」\n • Delaudio「name」\n •
Audiolist\n"
ret +=" • Addtext「name~/ text 」\n •
Deltext「name」\n • List text\n"
ret +=" • Addtext2「name~/ text 」\n •
Deltext2「name」\n • List text2\n"
ret +=" • Addcontact「name 」\n • Delcontact「name」\n
• List contact"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "translate":
ret = "How to use ?\n"
ret += "Use command :\n • Tr *lang* *text*\n"
ret += "Example :\n"
ret += " • Tr id khie cool\n"
ret += "How to find language?\n"
ret += "Use command :\n • Tr language"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "textspeech":
ret = "How to use ?\n"
ret += "Use command :\n • Say *lang* *text*\n"
ret += "Example :\n"
ret += " • Say id khie cool\n"
ret += "How to find language?\n"
ret += "Use command :\n • Say language"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "memegen":
ret = "How to use ?\n"
ret += "Use command :\n • Creatememe *text*|*text*|
*template*\n"
ret += "Example :\n"
ret += " • Creatememe khie|ganteng|buzz\n"
ret += "How to find template?\n"
ret += "Use command :\n • Template memegen"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "self":
contact = client.getContact(sender)
data = {
"type": "flex",
"altText": "࿇⊱┈──╌❯��� � � � � �� ❮╌ ──┈⊰࿇",
"contents": {
"type": "bubble",
'styles': {
"header": {
"backgroundColor": '#333333'
},
"body": {
"backgroundColor": '#FF00FF'
},
"footer": {
"backgroundColor": '#333333'
},
},
"header": {
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "text",
"text":
"{}".format(contact.displayName),
"weight": "bold",
"color": "#FFFFFF",
"size": "sm"
}
]
},
"hero": {
"type": "image",
"url": "https://obs.line-scdn.net/
{}".format(contact.pictureStatus),
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "fit",
"action": {
"type": "uri",
"uri": "line://ti/p/~ngapasii"
}
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "Name :",
"color": "#FFFFFF",
"size": "sm",
"flex": 0
},
{
"type": "text",
"text":
"{}".format(contact.displayName),
"color": "#FFFFFF",
"size": "sm",
"flex": 1
}
]
}
]
}
]
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"margin": "lg",
"spacing": "sm",
"contents": [
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴍʏᴘɪᴄᴛᴜʀᴇ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴍʏᴄᴏᴠᴇʀ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴍʏᴍɪᴅ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴍʏᴘʀᴏғɪʟᴇ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
" "text": ""⚪
ᴍʏᴠɪᴅɪᴏ",
"color": "#FFFFFF",
"size": "lg",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
{
"type": "box",
"layout": "baseline",
"spacing": "sm",
"contents": [
{
"type": "text",
"text": "�
�",
"color": "#000000",
"wrap": True,
"size": "sm",
"flex": 1
}
]
},
{
"type": "separator",
"color": "#C0C0C0",
},
]
}
]
}
}
}
sendTemplate(to, data)
elif cmd == "chatbot":
ret = "���� ���\n\n"
ret += " • Chatbot on\n"
ret += " • Chatbot off\n"
ret += " • Chatbot list"
hello = "{}".format(str(ret))
data = {
"type": "text",
"text": "{}".format(str(ret)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "c-allcontact":
G = client.getGroup(to)
for mem in G.members:
name = mem.displayName
icon = "https://os.line.naver.jp/os/p/" +
mem.mid
txt = mem.displayName
sendMessageCustomContact(to, icon, name,
mem.mid)
elif cmd == "chatbots":
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "「 Chatbot
」\n\nPlease type <query>\n\nQuery :\n\n1. Chatbot:on\n<to enabled your selfbot
mode>\n\n2. Chatbot:off\n<to disabled your selfbot mode>")
elif cmd == "grouplist":
key = settings["keyCommand"].title()
if settings['setKey'] == False:key = ''
gid = client.getGroupIdsJoined()
sd = client.getGroups(gid)
ret = "╭「 Groups 」─"
no = 0
total = len(gid)
cd = "\n│ Total {} Groups\n│\n├─「 COMMAND 」\n│\n│
Remote Mention\n│ Usage: Grouplist [num] tag [1|<|>|-]\n│ Remote Kick\n│ Usage:
Grouplist [num] kick [1|<|>|-]\n│ Leave Groups\n│ Usage: Leave [num]\n│ Get QR\n│
Usage: OpenQr [num]\n│ Cek Member\n│ Usage: Grouplist [num]\n╰ Usage: Grouplist
[num] mem [num]".format(total)
for G in sd:
member = len(G.members)
no += 1
ret += "\n│{}. {} | {}".format(no, G.name[0:20],
member)
ret += cd
k = len(ret)//10000
for aa in range(k+1):
# client.sendMessage(msg.to,'{}'.format(ret[aa*10000
: (aa+1)*10000]))
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id,
to,'{}'.format(ret[aa*10000 : (aa+1)*10000]))
elif cmd == "respon":
if msg.toType == 2:
group = client.getGroup(to)
nama = [contact.mid for contact in group.members]
for i in nama:
anu = client.getContact(i)
print(anu)
text = "{}".format(anu.displayName)
icon = "https://os.line.naver.jp/os/p/
{}".format(i)
name = "{}".format(anu.displayName)
sendMessageCustom(to, text, icon, name)
else:
anu = client.getContact(to)
#print(anu)
text = "{}".format(anu.displayName)
icon = "https://os.line.naver.jp/os/p/
{}".format(to)
name = "{}".format(anu.displayName)
sendMessageCustom(to, text, icon, name)
elif cmd == "c-respontag":
if msg.toType == 2:
group = client.getGroup(to)
nama = [contact.mid for contact in group.members]
#print(nama)
for i in nama:
#anu = client.getContact(i)
#print(anu)
ps = "{}".format(i)
#icon = "https://os.line.naver.jp/os/p/
{}".format(i)
#name = "{}".format(anu.displayName)
tagdia(msg.to, "@!",ps,[i])
else:
anu = client.getContact(to)
#print(anu)
text = "{}".format(anu.displayName)
icon = "https://os.line.naver.jp/os/p/
{}".format(to)
name = "{}".format(anu.displayName)
sendMessageCustom(to, text, icon, name)
#==========================================
elif cmd == "conban":
if wait["blacklist"] == {}:
client.sendMessage(msg.to,"No blacklist")
else:
ma = ""
for i in wait["blacklist"]:
ma = client.getContact(i)
client.sendMessage(msg.to, None,
contentMetadata={'mid': i}, contentType=13)
elif cmd == "uncloneprofile":
try:
restoreProfile()
client.sendContact(to,clientMID)
client.sendMessage(to, "back to the beginning ~")
except Exception as e:
client.sendMessage(to, "[ ERROR")
client.sendMessage(msg.to, str(e))
elif cmd == "mymid":
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "「 Mid 」\n
"+str(sender))
elif cmd == "myprofile":
contact = client.getContact(clientMID)
cu = client.getProfileCoverURL(clientMID)
path = str(cu)
image = "http://dl.profile.line-cdn.net/" +
contact.pictureStatus
client.sendImageWithURL(to, image)
client.sendImageWithURL(to, path)
client.sendMessage(to, "「 Profile 」\nMid :
"+str(sender)+"\nName : "+str(contact.displayName)+"\nStatus
:\n"+str(contact.statusMessage))
elif cmd == "myname":
h = client.getContact(clientMID)
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "「 Name
」\n"+str(h.displayName))
elif cmd == "mybio":
h = client.getContact(clientMID)
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "「 Status
」\n"+str(h.statusMessage))
elif cmd == "mypicture":
h = client.getContact(clientMID)
image = "http://dl.profile.line-cdn.net/" +
h.pictureStatus
client.generateReplyMessage(msg.id)
client.sendReplyImageWithURL(msg.id, to, image)
elif cmd == "myvideo":
h = client.getContact(clientMID)
if h.videoProfile == None:
return client.sendMessage(to, "「 Video 」\nNone")
client.generateReplyMessage(msg.id)
client.sendReplyVideoWithURL(msg.id,
to,"http://dl.profile.line-cdn.net/" + h.pictureStatus + "/vp")
elif cmd == "mycover":
h = client.getContact(clientMID)
cu = client.getProfileCoverURL(clientMID)
image = str(cu)
client.generateReplyMessage(msg.id)
client.sendReplyImageWithURL(msg.id, to, image)
elif cmd == "openqr":
if msg.toType == 2:
group = client.getGroup(to)
group.preventedJoinByTicket = False
client.updateGroup(group)
gurl = client.reissueGroupTicket(to)
client.sendMessage(msg.to,"QR Group open\n\n" +
"Link : line://ti/g/" + gurl)
elif cmd == "closeqr":
if msg.toType == 2:
group = client.getGroup(to)
group.preventedJoinByTicket = True
client.updateGroup(group)
client.sendMessage(msg.to,"QR Group close")
elif cmd == "leave":
if msg.toType == 2:
group = client.getGroup(to)
" client.sendMessage(to, "Bye bye "+str(group.name))
client.leaveGroup(to)
elif cmd == "timeleft":
timeNow = time.time()
runtime = timeNow - botStart
runtime = format_timespan(runtime)
client.sendMessage(to, "「 Time to due
」\n"+str(runtime))
elif cmd == "rejectall" and sender == clientMID:
ginvited = client.getGroupIdsInvited()
if ginvited != [] and ginvited != None:
for gid in ginvited:
client.rejectGroupInvitation(gid)
client.sendMessage(to, "Succes rejected 「 {} 」
invitetation".format(str(len(ginvited))))
else:
client.sendMessage(to, "Nothing")
elif cmd == "cancelall" and sender == clientMID:
if msg.toType == 2:
group = client.getGroup(to)
if group.invitee is None or group.invitee == []:
client.sendMessage(to, "Nothing")
else:
invitee = [contact.mid for contact in
group.invitee]
for inv in invitee:
client.cancelGroupInvitation(to, [inv])
time.sleep(1)
client.sendMessage(to, "Succes canceled 「 {}
」user".format(str(len(invitee))))
elif cmd == "nukeall":
if msg.toType == 2:
group = client.getGroup(to)
gMembers = [contact.mid for contact in
group.members]
for i in gMembers:
time.sleep(0.008)
client.kickoutFromGroup(to,[i])
client.sendMessage(to,"Just Some Casual Cleasing")
else:
client.sendMessage(to,"failed >_<")
# \\ COMMAND PROFILE //
elif cmd == "blocklist" and sender == clientMID:
blockedlist = client.getBlockedContactIds()
kontak = client.getContacts(blockedlist)
num=1
msgs="「 Blocked List 」\n"
for ids in kontak:
msgs+="\n%i. %s" % (num, ids.displayName)
num=(num+1)
msgs+="\n\nTotal Blocked : %i" % len(kontak)
msgs+= "\nBlockInfo「 number 」"
msgs+= "\nConBlock"
msgs+= "\nBlockfriend [@]"
msgs+= "\nBlockmid [mid]"
msgs+= "\nUnblockmid [mid]"
hello = "{}".format(str(msgs))
data = {
"type": "text",
"text": "{}".format(str(msgs)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == "favoritelist":
contactlist = client.getFavoriteMids()
kontak = client.getContacts(contactlist)
num=1
msgs="「 Favorite List 」\n"
for ids in kontak:
msgs+="\n%i. %s" % (num, ids.displayName)
num=(num+1)
msgs+="\n\n「 Total Favoritelist : %i 」" % len(kontak)
msgs+= "\nUsage : FavoriteInfo「 number 」"
hello = "{}".format(str(msgs))
data = {
"type": "text",
"text": "{}".format(str(msgs)),
"sentBy": {
"label":
"{}".format(client.getContact(clientMID).displayName),
"iconUrl": "https://obs.line-scdn.net/
{}".format(client.getContact(clientMID).pictureStatus),
"linkUrl": "line://ti/p/~ngapasii"
}
}
sendTemplate(to, data)
elif cmd == 'gift':
#. client.sendMessage(to, text=None,
contentMetadata={'PRDID': '350d37d6-bfc9-44cb-a0d1-cf17ae3657db','PRDTYPE':
'THEME','MSGTPL': '5'}, contentType=9)
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, text=None,
contentMetadata={'PRDID': '350d37d6-bfc9-44cb-a0d1-cf17ae3657db','PRDTYPE':
'THEME','MSGTPL': '5'}, contentType=9)
#=====================================================================
elif cmd == "changedp" and sender == clientMID:
settings["changePicture"] = True
client.sendMessage(to, "Type: Profile\n • Detail:
Change Profile Picture\n • Status: Waiting for picture\n Please send a picture...")
elif cmd == "change cover" and sender == clientMID:
settings["changeCover"] = True
client.sendMessage(to, "Type: Profile\n • Detail:
Change Home Photos\n • Status: Waiting for picture\nPlease send a picture...")
elif cmd == "changedp video" and sender == clientMID:
settings['changeProfileVideo']['status'] = True
settings['changeProfileVideo']['stage'] = 1
client.sendMessage(to, "Type: Profile\n • Detail:
Change Video Profile\n • Status: Waiting for video\nPlease send a video...")
elif cmd == "changedp group":
if msg.toType == 2:
if to not in settings["changeGroupPicture"]:
settings["changeGroupPicture"].append(to)
client.sendMessage(to, "Type: Group\n • Detail:
Change Group Picture\n • Status: Waiting for picture\nPlease send a picture...")
elif cmd == "fancypict off":
settings["fancy"]["status"] = False
settings["fancy"]["foto1"] = []
settings["fancy"]["foto2"] = []
settings["fancy"]["foto3"] = []
client.sendMessage(to, " 「 Fancy 」\nType: Fancy
picture\n • Status: DISABLED\n • Fancypict: Clear...")
elif cmd.startswith("fancypict on "):
settings['fancy']['foto1'] = []
settings['fancy']['foto2'] = []
settings['fancy']['foto3'] = []
if to not in settings["fancy"]["foto1"]:
settings["fancy"]["foto1"].append(to)
msg.text = client.mycmd(msg.text,wait)
wait['waktu'] = int(msg.text.split(" ")[2])
client.sendMessage(to, "Waiting for picture, please
send a picture...")
elif cmd == "changedp fancy":
settings["fancy"]["foto1"] = []
settings["fancy"]["foto2"] = []
settings["fancy"]["foto3"] = []
if to not in settings["fancy"]["foto1"]:
settings["fancy"]["foto1"].append(to)
wait['waktu'] = 5
client.sendMessage(to, "Waiting for picture...")
elif cmd == "picture uploaded to fancy picture 1":
if to not in settings["fancy"]["foto2"]:
settings["fancy"]["foto2"].append(to)
client.sendMessage(to, "Send pict again..")
elif cmd == "picture uploaded to fancy picture 2":
if to not in settings["fancy"]["foto3"]:
settings["fancy"]["foto3"].append(to)
client.sendMessage(to, "Send pict again...")
elif cmd.startswith("changemy video "):
link = removeCmd("changemy video", text)
contact = client.getContact(sender)
pic = "http://dl.profile.line-cdn.net/
{}".format(contact.pictureStatus)
pict = client.downloadFileURL(pic)
try:
r =
requests.get("http://rahandiapi.herokuapp.com/youtubeapi?
key=betakey&q={}".format(link))
data = r.text
data = json.loads(data)
for x in data["result"]["videolist"]:
if x["extension"] == "mp4" and x["resolution"]
== "720p":
client.sendMessage(to, "Type: Profile\n •
Detail: Change video\n • Status: Download...")
vids = client.downloadFileURL(x['url'])
changeVideoAndPictureProfile(pict, vids)
client.sendMessage(to, "Type: Profile\n •
Detail: Change video\n • Status: Succes")
else:pass
except:pass
elif cmd.startswith("vid "):
name = removeCmd("vid",text)
client.sendVideo(to, "tmp/{}".format(name))
elif cmd.startswith("addtext2 "):
if sender in clientMID:
sep = text.split(" ")
apl = text.replace(sep[0] + " ","")
sam = apl.split("~")
chat1 = sam[0]
chat2 = sam[1]
apk = ""+chat1
tes2["Message2"][apk] = chat2
tes2["msg2"] = chat1
anu = tes2["msg2"]+'.'
client.sendMessage(to,"Command %s
created."%chat1)
tes2["msg"] = {}
backupData()
elif cmd == "list text2":
if sender in clientMID:
backupData()
if tes2["Message2"] == {}:
client.sendMessage(to,"You don't have chat
message")
else:
mc = ""
jml = 1
for listword in tes2["Message2"]:
mc += "\n"+str(jml)+". "+listword+""
jml += 1
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "List
text :\n"+str(mc))
elif cmd.startswith("deltext2 "):
if sender in clientMID:
sep = text.split(" ")
xres = text.replace(sep[0] + " ","")
tetx = text.replace(sep[0] + " ","")
if xres in tes2["Message2"]:
del tes2["Message2"][xres]
client.sendMessage(to,"Command %s has been
removed."%tetx)
else:
client.sendMessage(to,"Command %s does not
exist."%tetx)
elif cmd.startswith("addtext "):
if sender in clientMID:
sep = text.split(" ")
apl = text.replace(sep[0] + " ","")
sam = apl.split("~")
chat1 = sam[0]
chat2 = sam[1]
apk = ""+chat1
tes["Message"][apk] = chat2
tes["msg"] = chat1
anu = tes["msg"]+'.'
client.sendMessage(to,"Command %s
created."%chat1)
tes["msg"] = {}
backupData()
elif cmd == "list text":
if sender in clientMID:
backupData()
if tes["Message"] == {}:
client.sendMessage(to,"You don't have chat
message")
else:
mc = ""
jml = 1
for listword in tes["Message"]:
mc += "\n"+str(jml)+". "+listword+""
jml += 1
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "List
text :\n"+str(mc))
elif cmd.startswith("video "):
try:
sep = msg.text.split(" ")
textToSearch = text.replace(sep[0] + " ","")
query = urllib.parse.quote(textToSearch)
url = "https://www.youtube.com/results?
search_query=" + query
response = urllib.request.urlopen(url)
html = response.read()
soup = BeautifulSoup(html, "html.parser")
results = soup.find(attrs={'class':'yt-uix-tile-
link'})
dl=("https://www.youtube.com" + results['href'])
vid = pafy.new(dl)
stream = vid.streams
for s in stream:
vin = s.url
hasil = "Youtube - Video :\n"
hasil += "\nTitle : {}".format(str(vid.title))
hasil += "\nSubscriber From :
{}".format(str(vid.author))
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,hasil)
client.sendVideoWithURL(msg.to,vin)
print("[YOUTUBE]MP4 Succes")
except Exception as e:
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,str(e))
elif cmd.startswith("deltext "):
if sender in clientMID:
sep = text.split(" ")
xres = text.replace(sep[0] + " ","")
tetx = text.replace(sep[0] + " ","")
if xres in tes["Message"]:
del tes["Message"][xres]
client.sendMessage(to,"Command %s has been
removed."%tetx)
else:
client.sendMessage(to,"Command %s does not
exist."%tetx)
elif cmd.startswith("stickers "):
search = removeCmd("stickers", text)
r =
requests.get("http://corrykalam.pw/api/lstickers.php?
search={}".format(str(search)))
data=r.text
data=json.loads(data)
if data["items"] != []:
no = 0
hasil = " 「 Line Stickers 」"
for sam in data["items"]:
no += 1
hasil += "\n " + str(no) + ". " +
str(sam["title"])+"\n"+"line.me/S/sticker/"+str(sam["id"])
client.sendMessage(to, str(hasil))
elif cmd.startswith("themes "):
search = removeCmd("themes", text)
r = requests.get("http://corrykalam.pw/api/ltheme.php?
search={}".format(str(search)))
data=r.text
data=json.loads(data)
if data["items"] != []:
no = 0
hasil = " 「 Line Themes 」"
for sam in data["items"]:
no += 1
hasil += "\n " + str(no) + ". " +
str(sam["title"])+"\n"+"line://shop/theme/detail?id="+str(sam["id"])
client.sendMessage(to, str(hasil))
elif cmd.startswith("drawsoupletters "):
q = removeCmd("drawsoupletters", text)
r =
requests.get("http://corrykalam.pw/api/sletters.php?text={}".format(str(q)))
data=r.text
data=json.loads(data)
client.sendImageWithURL(to,str(data["image"]))
elif cmd.startswith("drawstreets "):
sep = text.split(" ")
txt = text.replace(sep[0] + " ","")
r = requests.get("http://corrykalam.pw/api/streets.php?
text="+urllib.parse.quote(txt))
data=r.text
data=json.loads(data)
client.sendImageWithURL(to,str(data["image"]))
elif cmd.startswith("drawwindow "):
q = removeCmd("drawwindow", text)
r = requests.get("http://corrykalam.pw/api/fwindow.php?
text={}&btype=3".format(str(q)))
data=r.text
data=json.loads(data)
client.sendImageWithURL(to,str(data["image"]))
elif cmd.startswith("drawcookies "):
q = removeCmd("drawcookies", text)
r =
requests.get("http://corrykalam.pw/api/wcookies.php?text={}".format(str(q)))
data=r.text
data=json.loads(data)
client.sendImageWithURL(to,str(data["image"]))
elif cmd.startswith("drawlight "):
q = removeCmd("drawlight", text)
r =
requests.get("http://corrykalam.pw/api/graffiti.php?text={}".format(str(q)))
data=r.text
data=json.loads(data)
client.sendImageWithURL(to,str(data["image"]))
elif cmd.startswith("zodiac "):
text = removeCmd("zodiac", text)
sep = text.split(" ")
url = text.replace(sep[0] + " ", text)
with requests.session() as s:
s.headers['user-agent'] = "Mozilla/5.0 (Windows NT
6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
r = s.get("https://www.vemale.com/zodiak/
{}".format(urllib.parse.quote(url)))
soup = BeautifulSoup(r.content, 'html5lib')
ret_ = ""
for a in soup.select('div.vml-zodiak-detail'):
ret_ += a.h1.string
ret_ += "\n"+ a.h4.string
ret_ += " : "+ a.span.string +""
for b in soup.select('div.col-center'):
ret_ += "\nTanggal : "+ b.string
for d in soup.select('div.number-zodiak'):
ret_ += "\nAngka keberuntungan : "+ d.string
for c in soup.select('div.paragraph-left'):
ta = c.text
tab = ta.replace(" ", "")
tabs = tab.replace(".", ".\n")
ret_ += "\n"+ tabs
#print (ret_)
client.sendMessage(msg.to, str(ret_))
elif cmd.startswith("fs "):
sep = text.split(" ")
txt = text.replace(sep[0] + " ","")
url =
"https://rest.farzain.com/api/special/fansign/cosplay/cosplay.php?
apikey=nda12345&text={}".format(txt)
client.sendImageWithURL(to, url)
elif cmd.startswith("spamgift "):
text = removeCmd("spamgift", text)
korban = text.replace('spamgift ', text)
korban2 = korban.split()
midd = korban2[0]
jumlah = int(korban2[1])
if jumlah <= 1000:
for var in range(0,jumlah):
client.sendMessage(midd, None,
contentMetadata={'PRDID': 'a0768339-c2d3-4189-9653-2909e9bb6f58', 'PRDTYPE':
'THEME', 'MSGTPL': '6'}, contentType=9)
client.sendMessage(to, "Succes ~")
elif cmd.startswith("gift "):
query = removeCmd("gift", text)
text = query.split("-")
message = text[0]
number = text[1]
groups = client.getGroupIdsJoined()
try:
group = groups[int(number)-1]
G = client.getGroup(group)
try:
client.sendGift(group,str(message),'sticker')
except:
client.sendGift(group,str(message),'sticker')
client.sendMessage(to, "「 Remote Gift
」\n\nGroup : " + G.name)
except Exception as error:
client.sendMessage(to, str(error))
elif cmd.startswith("sendfile"):
text = removeCmd("sendfile", text)
sep = text.split(" ")
file = text.replace(sep[0] + " ", text)
time.sleep(1)
client.sendFile(to,file)
elif cmd.startswith("xxx "):
proses = text.split(" ")
urutan = text.replace(proses[0] + " ","")
count = urutan.split("|")
search = str(count[0])
r = requests.get("https://api.avgle.com/v1/search/{}/1?
limit=10".format(str(search)))
data = json.loads(r.text)
if len(count) == 1:
no = 0
hasil = "「 Search video 18+ 」\n"
for aa in data["response"]["videos"]:
no += 1
hasil += "\n"+str(no)+". "+str(aa["title"])
+"\nDurasi : "+str(aa["duration"])
ret_ = "\n\nXxx {} |
Number".format(str(search))
client.sendMessage(msg.to,hasil+ret_)
elif len(count) == 2:
try:
num = int(count[1])
b = data["response"]["videos"][num - 1]
c = str(b["vid"])
d =
requests.get("https://api.avgle.com/v1/video/"+str(c))
data1 = json.loads(d.text)
hasil = "Title : "+str(data1["response"]
["video"]["title"])
hasil += "\n\nDurasi : "+str(data1["response"]
["video"]["duration"])
hasil += "\nKualitas HD :
"+str(data1["response"]["video"]["hd"])
hasil += "\nDitonton "+str(data1["response"]
["video"]["viewnumber"])
#e = requests.get("https://api-
ssl.bitly.com/v3/shorten?
access_token=c52a3ad85f0eeafbb55e680d0fb926a5c4cab823&longUrl="+str(data1["response
"]["video"]["video_url"]))
#data2 = json.loads(e.text)
hasil += "\nLink video :
"+str(data1["response"]["video"]["video_url"])
hasil += "\nLink embed :
"+str(data1["response"]["video"]["embedded_url"])
client.sendMessage(msg.to,hasil)
anuanu = str(data1["response"]["video"]
["preview_url"])
path = client.downloadFileURL(anuanu)
client.sendImage(msg.to,path)
#cl.sendVideoWithURL(msg.to, data["data"]
["url"])
except Exception as e:
client.sendMessage(msg.to," "+str(e))
elif cmd.startswith("idline "):
a = removeCmd("idline", text)
b = client.findContactsByUserid(a)
line = b.mid
client.sendMessage(msg.to,"http://line.me/ti/p/~" + a)
client.sendContact(to, line)
client.sendMessage(to,str(hasil))
elif cmd.startswith("blockinfo "):
number = removeCmd("blockinfo", text)
contactlist = client.getBlockedContactIds()
try:
contact = contactlist[int(number)-1]
friend = client.getContact(contact)
cu = client.getProfileCoverURL(contact)
path = str(cu)
image = "http://dl.profile.line-cdn.net/" +
friend.pictureStatus
try:
client.sendMessage(to,"「 Block Info 」\n\n" +
"Name : " + friend.displayName + "\nStatus : " + friend.statusMessage + "\nMid : "
+ friend.mid)
client.sendImageWithURL(to,image)
client.sendImageWithURL(to,path)
client.sendContact(to, friend.mid)
except:
pass
except Exception as error:
client.sendMessage(to, "「 Result Error 」\n" +
str(error))
elif cmd.startswith("favoriteinfo "):
text = removeCmd("favoriteinfo", text)
separate = text.split(" ")
number = text.replace(separate[0] + " ", text)
contactlist = client.getFavoriteMids()
try:
contact = contactlist[int(number)-1]
friend = client.getContact(contact)
cu = client.getProfileCoverURL(contact)
path = str(cu)
image = "http://dl.profile.line-cdn.net/" +
friend.pictureStatus
try:
client.sendMessage(to,"「 Favorite Info」\n\n"
+ "Name : " + friend.displayName + "\nStatus : " + friend.statusMessage + "\nMid :
" + friend.mid)
client.sendImageWithURL(to,image)
client.sendImageWithURL(to,path)
client.sendContact(to, friend.mid)
except:
pass
except Exception as error:
client.sendMessage(to, "Result Error\n" +
str(error))
elif cmd.startswith("savefile"):
text = removeCmd("savefile", text)
sep = text.split(" ")
key = text.replace(sep[0] + " ", text)
if " " in key:
client.sendMessage(to, "Failed !")
else:
hoho["namafile"] = str(key).lower()
hoho["savefile"] = True
client.sendMessage(to, "Send file to save to be「
{} 」".format(str(key).lower()))
elif cmd.startswith("imagehd "):
query = removeCmd("imagehd", text)
cond = query.split("|")
search = str(cond[0])
result = requests.get("https://api.eater.pw/wallp/
{}".format(str(search)))
data = result.text
data = json.loads(data)
if data["result"] != []:
ret_ = []
for fn in data["result"]:
if 'http://' in fn["link"]:
pass
else:
if len(ret_) >= 10:
pass
else:
ret_.append({
"imageUrl":
"{}".format(str(fn["link"])),
"action": {
"type": "uri",
"label": "Send Image",
"uri":
"line://app/1602687308-GXq4Vvk9?type=image&img={}".format(str(fn["link"]))
}
}
)
k = len(ret_)//10
for aa in range(k+1):
data = {
"type": "template",
"altText": "Image HD",
"template": {
"type": "image_carousel",
"columns": ret_[aa*10 : (aa+1)*10]
}
}
sendTemplate(to, data)
client.likePost(c,b,random.choice([1001,1002,1003,1004,1005]))
client.createComment(c,b,
wait["autoLike"]['comment'])
wait['postId'].append(b)
else:
pass
client.sendMessage(to, "Like done..")
except Exception as e:
client.sendMessage(to, str(e))
elif cmd.startswith("sharepost "):
j = int(cmd.split(' ')[2])
a = [client.adityasplittext(cmd,'s').replace('{}
'.format(j),'')]*j
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
lists.append(mention["M"])
for ls in lists:
try:
e = client.getHomeProfile(ls)
for i in e['result']['feeds']:
b = i['post']['postInfo']['postId']
f = [client.sendPostToTalk(to,b) for g
in a]
except Exception as e:
print(e)
elif cmd.startswith("ulti "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
try:
client.kickoutFromGroup(to, [ls])
client.findAndAddContactsByMid(ls)
client.inviteIntoGroup(to, [ls])
client.cancelGroupInvitation(to, [ls])
except:
client.sendMessage(to, "Limited !")
elif cmd.startswith("cloneprofile "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
if len(lists) != []:
ls = random.choice(lists)
cloneProfile(ls)
client.sendContact(to,clientMID)
client.sendMessage(to, "Has been Clone ~")
elif cmd.startswith("tban "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
try:
apalo["Talkblacklist"][ls] = True
client.sendMessage(to, 'Add to TalkBan')
except:
pass
elif cmd.startswith("tunban "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
try:
del apalo["Talkblacklist"][ls]
client.sendMessage(to, 'Deleted from
TalkBan')
except:
pass
elif cmd.startswith("mentionmid "):
contact = removeCmd("mentionmid", text)
sendMention(to, contact)
elif cmd.startswith("slain "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
try:
client.kickoutFromGroup(to, [ls])
client.findAndAddContactsByMid(ls)
client.inviteIntoGroup(to, [ls])
client.cancelGroupInvitation(to, [ls])
time.sleep(5)
client.inviteIntoGroup(to, [ls])
except:
client.sendMessage(to, "Limited !")
elif cmd.startswith("reinv "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
try:
client.findAndAddContactsByMid(ls)
client.kickoutFromGroup(to, [ls])
time.sleep(5)
client.inviteIntoGroup(to, [ls])
except:
client.sendMessage(to, "Limited !")
elif cmd.startswith("invite "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
try:
client.findAndAddContactsByMid(ls)
client.inviteIntoGroup(to, [ls])
except:
client.sendMessage(to, "Limited !")
elif cmd.startswith("tes "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
contact = client.getContact(ls)
try:
rename = contact.displayNameOverridden
except:
rename = "「 Display Rename 」\nERROR"
client.sendMessage(to, "「 Display Name 」\n" +
contact.displayName + "\n\n「 Display Rename 」\n{}".format(rename))
elif cmd.startswith("lastseen "):
if 'MENTION' in msg.contentMetadata.keys() != None:
names = re.findall(r'@(\w+)', msg.text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
for mention in mentionees:
if mention['M'] in seens["find"]:
mentions(msg.to, "@! "+seens["username"]
[mention['M']], [mention['M']])
else:
mentions(msg.to, "@! \nnot found in any
groups.", [mention['M']])
print(seens)
elif cmd.startswith("clone "):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
clone =
ast.literal_eval(msg.contentMetadata['MENTION'])
clones = clone['MENTIONEES']
target = []
for clone in clones:
if clone["M"] not in target:
target.append(clone["M"])
for she in target:
BackupProfile = client.getContact(sender)
Save1 = "http://dl.profile.line-cdn.net/
{}".format(BackupProfile.pictureStatus);Save2 =
"{}".format(BackupProfile.displayName);ProfileMe["PictureMe"] =
Save1;ProfileMe["NameMe"] = Save2
contact = client.getContact(she);ClonerV2(she)
sendMention(to, contact.mid, "「 Clone Profile
」\n", "\nStatus : Success");client.sendContact(to,
str(BackupProfile.mid));client.sendContact(to, str(contact.mid))
elif cmd == "unclone":
try:
clientProfile = client.getProfile()
clientName = client.getProfile()
clientProfile.statusMessage =
str(ProfileMe["myProfile"]["statusMessage"])
clientProfile.pictureStatus =
str(ProfileMe["myProfile"]["pictureStatus"])
clientName.displayName = ProfileMe["NameMe"]
client.updateProfile(clientName)
path =
client.downloadFileURL(ProfileMe["PictureMe"])
client.updateProfilePicture(path)
coverId = str(ProfileMe["myProfile"]["coverId"])
client.updateProfileCoverById(coverId)
BackupProfile = client.getContact(sender)
sendMention(to, BackupProfile.mid, "「 Unclone
Profile 」\n", "\nStatus : Success");client.sendContact(to, str(BackupProfile.mid))
except Exception as error:
client.sendMessage(to, "Failed to Backup")
elif cmd.startswith("kick ") and sender == clientMID:
targets = []
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"] [0] ["M"]
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
client.kickoutFromGroup(to,[target])
#time.sleep(1)
except Exception as e:
client.sendMessage(to, str(e))
elif cmd.startswith("creategroup "):
text = removeCmd("creategroup", text)
sep = text.split(" ")
name = text.replace(sep[0] + " ", text)
client.createGroup(name, [clientMID])
gids = client.getGroupIdsByName(name)
for gid in gids:
try:
x = client.getGroup(gid)
x.preventedJoinByTicket = False
client.updateGroup(x)
except Exception as e:
client.sendMessage(to, str(e))
client.sendMessage(to, "Create Group {}\n\nQR :
http://line.me/R/ti/g/{}".format(str(name), str(client.reissueGroupTicket(x.id))))
elif cmd.startswith('c-talk'):
client.unsendMessage(msg.id)
txt = client.mycmd(msg.text,wait)
j = int(cmd.split(' ')[1])
a = [client.adityasplittext(cmd,'s').replace('{}
'.format(j),'')]*j
if 'MENTION' in msg.contentMetadata.keys() != None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for ls in lists:
anu = client.getContact(ls)
ps = "{}".format(ls)
if len(cmd.split(" ")) >= 5000:
mid = "{}".format(ls)
icon = "http://dl.profile.line.naver.jp/
{}".format(anu.pictureStatus)
name = "{}".format(anu.displayName)
tagdia(to, " 「 Auto Respons 」\n@!",ps,
[ls])
scont(to, mid, icon, name)
if len(cmd.split("\n")) >= 2:
mid = "{}".format(ls)
text =
"{}".format(str(msg.text.replace(msg.text.split("\n")[0]+"\n","")))
icon = "http://dl.profile.line.naver.jp/
{}".format(anu.pictureStatus)
name = "{}".format(anu.displayName)
b = [sendMessageCustom(to, text, icon,
name) for b in a]
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id,
to, client.getContact(target).displayName+":\n\n" +
client.getContact(target).statusMessage)
except:
pass
elif cmd.startswith("contact "):
name = removeCmd("contact", text)
user = client.getAllContactIds()
ahay = client.getContacts(user)
targets = []
for contact in ahay:
if name in contact.displayName.lower():
targets.append(contact.mid)
if targets == []:
client.sendMessage(to,"Contact Not found.")
else:
for target in targets:
try:
M = Message()
M.to = to
M.contentType = 13
M.contentMetadata = {'mid': target}
mentions(to, "User identifier: " +
target + "\n\nUser Name: @!" + "\n\nUser status: " +
client.getContact(target).statusMessage,[target])
client.sendContact(to,target)
except:
pass
elif cmd.startswith("whois "):
if msg.toType == 2:
_name = removeCmd("whois", text)
gs = client.getGroup(to)
targets = []
for g in gs.members:
if _name in g.displayName.lower():
targets.append(g.mid)
if targets == []:
client.sendMessage(to,"Not found.")
else:
for target in targets:
try:
M = Message()
M.to = to
M.contentType = 13
M.contentMetadata = {'mid':
target}
mentions(to, "User identifier:
" + target + "\n\nUser Name: @!" + "\n\nUser status: " +
client.getContact(target).statusMessage,[target])
client.sendContact(to,target)
except:
pass
elif cmd.startswith("update post "):
try:
j = int(cmd.split(' ')[2])
timer = str(cmd.split(' ')[3])
a = [client.adityasplittext(cmd,'s').replace('{}
{}'.format(j,timer),'')]*j
text = cmd.replace('update post {}
{}'.format(int(j),timer),'')
if timer == "1hari":holdingTime = 86400
if timer == "6jam":holdingTime = 21600
if timer == "1jam":holdingTime = 3600
if timer == "1menit":holdingTime = 60
times = int(holdingTime)
try:
f = [client.createPost(text,times) for f in a]
except Exception as e:
client.sendMessage(to, str(e))
except Exception as e:
client.sendMessage(to, str(e))
elif cmd.startswith("updatepost "):
try:
khie = text.split(" ")
agri = text.replace(khie[0] + " ","")
try:
f = client.createPost(agri)
client.sendPostToTalk(to,f["result"]["feed"]
["post"]["postInfo"]["postId"])
except Exception as e:
client.sendMessage(to, str(e))
except Exception as e:
client.sendMessage(to, str(e))
elif cmd.startswith("create note "):
cmd = cmd.replace('create note ','')
NoteCreate(to,cmd,msg)
elif cmd.startswith("dick "):
khie = removeCmd("dick", text)
s = urllib.parse.quote(khie)
client.sendMessage(to,"http://en.inkei.net/dick/"+s)
elif cmd.startswith("anus "):
khie = removeCmd("anus", text)
s = urllib.parse.quote(khie)
client.sendMessage(to,"http://en.inkei.net/anus/"+s)
elif cmd.startswith("tits "):
khie = removeCmd("tits", text)
s = urllib.parse.quote(khie)
client.sendMessage(to,"http://en.inkei.net/tits/"+s)
elif cmd.startswith("vagina "):
khie = removeCmd("vagina", text)
s = urllib.parse.quote(khie)
client.sendMessage(to,"http://en.inkei.net/vagina/"+s)
elif cmd.startswith("countdown "):
number = removeCmd("countdown", text)
if len(number) > 0:
if number.isdigit():
number = int(number)
if number > 500:
client.sendMessage(to,"invalid >_< ! Max:
100.")
else:
for i in range(0,number):
client.sendMessage(to,str(number))
number -= 1
time.sleep(0.008)
else:
client.sendMessage(to,"Please specify a valid
number.")
elif cmd.startswith("countforward "):
number = removeCmd("countforward", text)
if len(number) > 0:
if number.isdigit():
number = int(number)
if number > 500:
client.sendMessage(to,"Invalid >_< ! Max
100.")
else:
for i in range(0,number):
client.sendMessage(to,str(i+1))
i += 1+1
time.sleep(0.008)
else:
client.sendMessage(to,"Please input count
number.")
if text.startswith("b64encode "):
de_str = msg.text.replace("b64encode ","")
hasil = base64.b64encode(de_str.encode())
client.sendMessage(to,str(hasil.decode('utf-8')))
if text.startswith("b64decode "):
de_str = msg.text.replace("b64decode ","")
hasil = base64.b64decode(de_str.encode())
client.sendMessage(to,str(hasil.decode('utf-8')))
#=====================================================================
#=====================================================================
elif cmd == "mentionall -s":
client.unsendMessage(msg_id)
try:group = client.getGroup(msg.to);nama = [contact.mid
for contact in group.members];nama.remove(client.getProfile().mid)
except:group = client.getRoom(msg.to);nama =
[contact.mid for contact in group.contacts]
k = len(nama)//20
for a in range(k+1):
if a ==
0:client.mentionmention(to=msg.to,wait=wait,text='',dataMid=nama[:20],pl=0,ps='╭「
Mention 」─',pg='MENTIONALLUNSED',pt=nama)
else:client.mentionmention(to=msg.to,wait=wait,text='',dataMid=nama[a*20 :
(a+1)*20],pl=a*20,ps='├「 Mention 」─',pg='MENTIONALLUNSED',pt=nama)
elif cmd == "mentionall":
group = client.getGroup(to);nama = [contact.mid for
contact in group.members];nama.remove(client.getProfile().mid)
client.datamention(to,'Mention',nama)
elif cmd.startswith('mention '):
msg.text = client.mycmd(msg.text,wait)
if msg.toType == 0:
client.datamention(to,'Spam',[to]*int(cmd.split("
")[1]))
elif msg.toType == 2:
gs = client.getGroup(to)
nama = [contact.mid for contact in gs.members]
try:
if 'MENTION' in msg.contentMetadata.keys()!
=None:client.datamention(to,'Spam',[eval(msg.contentMetadata["MENTION"])
["MENTIONEES"][0]["M"]]*int(cmd.split(" ")[1]))
else:texst = client.adityasplittext(cmd)
gs = client.getGroup(to)
nama = [contact.mid for contact in
gs.members];nama.remove(client.getProfile().mid)
c = ['{}:-:{}'.format(a.displayName,a.mid) for
a in gs.members]
c.sort()
b = []
for s in c:
if len(texst) == 1:dd = s[len(texst)-
1].lower()
else:dd = s[:len(texst)].lower()
if texst in dd:b.append(s.split(':-:')[1])
client.datamention(to,'Mention By Abjad',b)
except:client.adityaarchi(wait,'Mention','',to,client.adityasplittext(msg.text),msg
,'\n├Group: '+gs.name[:20],nama=nama)
elif cmd.startswith('mentionname '):
texst = client.adityasplittext(cmd)
gs = client.getGroup(to)
c = ['{}:-:{}'.format(a.displayName,a.mid) for a in
gs.members]
c.sort()
b = []
for s in c:
if texst in s.split(':-:')
[0].lower():b.append(s.split(':-:')[1])
client.datamention(to,'Mention By Name',b)
elif cmd == "check mention":
if to in wait['ROM']:
moneys = {}
msgas = ''
for a in wait['ROM'][to].items():
moneys[a[0]] = [a[1]['msg.id'],a[1]['waktu']]
if a[1] is not None else idnya
sort = sorted(moneys)
sort.reverse()
sort = sort[0:]
msgas = ' 「 Mention Me 」'
h = []
no = 0
for m in sort:
has = ''
nol = -1
for kucing in moneys[m][0]:
nol+=1
has+= '\nline://nv/chatMsg?
chatId={}&messageId={}
{}'.format(to,kucing,humanize.naturaltime(datetime.fromtimestamp(moneys[m][1]
[nol]/1000)))
h.append(m)
no+=1
if m == sort[0]:
msgas+= '\n{}. @!
{}x{}'.format(no,len(moneys[m][0]),has)
else:
msgas+= '\n\n{}. @!
{}x{}'.format(no,len(moneys[m][0]),has)
mentions(to, msgas, h)
del wait['ROM'][to]
else:
try:
mids = ["u3e941ed98d2a98e04ad01784b7baacf6"]
msgas = 'Sorry @!In {} nothink get a
mention'.format(client.getGroup(to).name)
mentions(to, msgas, [clientMID])
except:
mids = ["u3e941ed98d2a98e04ad01784b7baacf6"]
msgas = 'Sorry @!In Chat @!nothink get a
mention'
mentions(to, msgas, [clientMID])
elif cmd.startswith("ginfo "):
number = removeCmd("ginfo",text)
groups = client.getGroupIdsJoined()
ret_ = ""
try:
group = groups[int(number)-1]
G = client.getGroup(group)
path = "http://dl.profile.line-cdn.net/" +
G.pictureStatus
try:
gCreator = G.creator.displayName
except:
gCreator = "Tidak ditemukan"
if G.invitee is None:
gPending = "0"
else:
gPending = str(len(G.invitee))
if G.preventedJoinByTicket == True:
gQr = "Tertutup"
gTicket = "Tidak ada"
else:
gQr = "Terbuka"
gTicket = "https://line.me/R/ti/g/
{}".format(str(client.reissueGroupTicket(G.id)))
timeCreated = []
timeCreated.append(time.strftime("%d-%m-%Y [ %H:%M:
%S ]", time.localtime(int(G.createdTime) / 1000)))
ret_ += "「 Group Info 」\n"
ret_ += "\nNama Group : {}".format(G.name)
ret_ += "\nID Group : {}".format(G.id)
ret_ += "\nPembuat : {}".format(gCreator)
ret_ += "\nWaktu Dibuat :
{}".format(str(timeCreated))
ret_ += "\nJumlah Member :
{}".format(str(len(G.members)))
ret_ += "\nJumlah Pending : {}".format(gPending)
ret_ += "\nGroup Qr : {}".format(gQr)
ret_ += "\nGroup Ticket : {}".format(gTicket)
client.sendImageWithURL(to, path)
client.sendMessage(to, str(ret_))
client.sendContact(to, G.creator.mid)
except:
pass
elif cmd.startswith("changegn"):
if msg.toType == 2:
X = client.getGroup(to)
X.name = removeCmd("changegn", text)
client.updateGroup(X)
else:client.mentionmention(to=to,wait=wait,text='',dataMid=chiya[a*100 :
(a+1)*100],pl=a*100,ps='├「 Lurkers 」─',pg='SIDERMES',pt=chiya)
wait['lurkt'][to][targets] = {};wait['lurkp']
[to][targets] = {}
else:client.sendMention(to, " 「 Lurk 」\nLurk in
@! not active",'',[targets])
#=====================================================================
#=====================================================================
elif cmd.startswith("add pict ") and sender == clientMID:
load()
name = removeCmd("add pict", text)
name = name.lower()
if name not in images:
settings["addImage"]["status"] = True
settings["addImage"]["name"] = str(name.lower())
images[str(name.lower())] = ""
f = codecs.open('image.json','w','utf-8')
json.dump(images, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Type: Picture\n • Detail:
Add picture\n • Statud: Send pict...")
else:
client.sendMessage(to, "Type: Picture\n • Detail:
Add picture\n • Status: Failed, Picture already in list...")
elif cmd.startswith("del pict ") and sender == clientMID:
load()
name = removeCmd("del pict", text)
name = name.lower()
if name in images:
client.deleteFile(images[str(name.lower())])
del images[str(name.lower())]
f = codecs.open('image.json','w','utf-8')
json.dump(images, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Type: Picture\n • Detail:
Delete list picture\n • Status: Succes delete Picture
{}".format(str(name.lower())))
else:
client.sendMessage(to, "Type: Picture\n • Detail:
Delete list picture\n • Status: Failed, Picture not in list...")
elif cmd.startswith("changepict ") and sender == clientMID:
load()
name = removeCmd("changepict", text)
name = name.lower()
if name in images:
settings["addImage"]["status"] = True
settings["addImage"]["name"] = str(name.lower())
images[str(name.lower())] = ""
f = codecs.open('image.json','w','utf-8')
json.dump(images, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Type: Picture\n • Detail:
Change picture\n • Status: Send pict...")
else:
client.sendMessage(to, "Type: Picture\n • Detail:
Change picture\n • Status: Failed, Picture not in list...")
elif cmd == "list pict":
load()
no = 0
ret_ = " 「 List Picture 」"
for image in images:
no += 1
ret_ += "\n{}. {}".format(int(no), image.title())
ret_ += "\n\nTotal {} Picture".format(str(len(images)))
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, ret_)
elif cmd.startswith("sendpict ") and sender == clientMID:
load()
text = removeCmd("sendpict", text)
cond = text.split(" ")
jml = int(cond[0])
imagename = text.replace(cond[0] + " ","").lower()
if imagename in images:
imgURL = images[imagename]
else:
client.sendMessage(to, "Type: Picture\n • Detail:
Send picture\n • Status: Failed, Picture name not in list...")
return
for x in range(jml):
client.sendImage(to, imgURL)
#=====================================================================
#=====================================================================
elif cmd.startswith("add sticker1 ") and sender ==
clientMID:
load()
name = removeCmd("add sticker1", text)
name = name.lower()
if name not in stickers1:
nissa["addTikel2"]["status"] = True
nissa["addTikel2"]["name"] = name.lower()
stickers1[name.lower()] = {}
f = codecs.open('sticker1.json','w','utf-8')
json.dump(stickers1, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Send stickers to save as {}
".format(name.lower()))
else:
client.sendMessage(to, "Stickers {} already in
list.".format(name.lower()))
elif cmd.startswith("del sticker1 ") and sender ==
clientMID:
name = removeCmd("del sticker1", text)
name = name.lower()
if name in stickers1:
del stickers1[name.lower()]
f = codecs.open('sticker1.json','w','utf-8')
json.dump(stickers2, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Success delete stickers {}
".format(name.lower()))
else:
client.sendMessage(to, "Stickers {} not found in
list.".format(name.lower()))
elif cmd.startswith("add sticker2 ") and sender ==
clientMID:
load()
name = removeCmd("add sticker2", text)
name = name.lower()
if name not in stickers2:
anyun["addTikel"]["status"] = True
anyun["addTikel"]["name"] = name.lower()
stickers2[name.lower()] = {}
f = codecs.open('sticker2.json','w','utf-8')
json.dump(stickers2, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Send stickers to save as {}
".format(name.lower()))
else:
client.sendMessage(to, "Stickers {} already in
list.".format(name.lower()))
elif cmd.startswith("del sticker2 ") and sender ==
clientMID:
name = removeCmd("del sticker2", text)
name = name.lower()
if name in stickers2:
del stickers2[name.lower()]
f = codecs.open('sticker2.json','w','utf-8')
json.dump(stickers2, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Success delete stickers {}
".format(name.lower()))
else:
client.sendMessage(to, "Stickers {} not found in
list.".format(name.lower()))
elif cmd.startswith("add sticker ") and sender ==
clientMID:
load()
name = removeCmd("add sticker", text)
name = name.lower()
if name not in stickers:
settings["addSticker"]["status"] = True
settings["addSticker"]["name"] = str(name.lower())
stickers[str(name.lower())] = {}
f = codecs.open('sticker.json','w','utf-8')
json.dump(stickers, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Type: Stickers\n • Detail:
Add sticker\n • Status: Send sticker..")
else:
client.sendMessage(to, "Type: Stickers\n • Detail:
Add sticker\n • Status: Failed, Sticker name already in list..")
elif cmd.startswith("del sticker ") and sender ==
clientMID:
load()
name = removeCmd("del sticker", text)
name = name.lower()
if name in stickers:
del stickers[str(name.lower())]
f = codecs.open('sticker.json','w','utf-8')
json.dump(stickers, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Type: Sticker\n • Detail:
Delete sticker\n • Status: Succes delete Sticker {}".format(str(name.lower())))
else:
client.sendMessage(to, "Type: Sticker\n • Detail:
Delete sticker\n • Status: Failed, Sticker name not in list")
elif cmd.startswith("changesticker ") and sender ==
clientMID:
load()
name = removeCmd("changesticker", text)
name = name.lower()
if name in stickers:
settings["addSticker"]["status"] = True
settings["addSticker"]["name"] = str(name.lower())
stickers[str(name.lower())] = ""
f = codecs.open('sticker.json','w','utf-8')
json.dump(stickers, f, sort_keys=True, indent=4,
ensure_ascii=False)
client.sendMessage(to, "Type: Stickers\n • Detail:
Change sticker\n • Status: Send sticker..")
else:
client.sendMessage(to, "Type: Stickers\n • Detail:
Change sticker\n • Status: Failed, Sticker not in list..")
elif cmd == "list sticker2":
load()
ret_ = "「 Sticker List 」\n"
for sticker in stickers2:
ret_ += "\n" + sticker.title()
ret_ += "\n\nTotal {}
Stickers".format(str(len(stickers2)))
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, ret_)
elif cmd == "list sticker1":
load()
ret_ = "「 Sticker List 」\n"
for sticker in stickers1:
ret_ += "\n" + sticker.title()
ret_ += "\n\nTotal {}
Stickers".format(str(len(stickers1)))
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, ret_)
elif cmd == "list sticker":
load()
ret_ = "「 Sticker List 」\n"
for sticker in stickers:
ret_ += "\n" + sticker.title()
ret_ += "\n\nTotal {}
Stickers".format(str(len(stickers)))
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, ret_)
elif cmd.startswith("sendsticker ") and sender ==
clientMID:
load()
text = removeCmd("sendsticker", text)
cond = text.split(" ")
jml = int(cond[0])
stickername = text.replace(cond[0] + " ","").lower()
if stickername in stickers:
sid = stickers[stickername]["STKID"]
spkg = stickers[stickername]["STKPKGID"]
sver = stickers[stickername]["STKVER"]
else:
return
for x in range(jml):
sendStickers(to, sver, spkg, sid)
elif cmd.startswith("lyrics "):
anu = removeCmd("lyrics", text)
slyric(to, text)
elif cmd.startswith("searchlyric "):
sep = text.split(" ")
txt = text.replace(sep[0] + " ","")
cond = txt.split("|")
query = cond[0]
key = settings["keyCommand"].title()
if settings["setKey"] == False:key = ''
with requests.session() as web:
web.headers["user-agent"] = "Mozilla/5.0"
url = web.get("https://www.musixmatch.com/search/
{}".format(urllib.parse.quote(query)))
data = BeautifulSoup(url.content, "html.parser")
result = []
for trackList in data.findAll("ul",
{"class":"tracks list"}):
for urlList in trackList.findAll("a"):
title = urlList.text
url = urlList["href"]
result.append({"title": title, "url": url})
if len(cond) == 1:
ret_ = "Lyric Result :\n"
num = 0
for title in result:
num += 1
ret_ += "\n{}. {}".format(str(num),
str(title["title"]))
ret_ += "\n\nTotal {}
Lyric".format(str(len(result)))
ret_ += "\n\nSearchLyric {}|
「number」".format(str(query))
client.sendMessage(to, ret_)
elif len(cond) == 2:
num = int(cond[1])
if num <= len(result):
data = result[num - 1]
with requests.session() as web:
web.headers["user-agent"] =
"Mozilla/5.0"
url =
web.get("https://www.musixmatch.com{}".format(urllib.parse.quote(data["url"])))
data = BeautifulSoup(url.content,
"html5lib")
for lyricContent in data.findAll("p",
{"class":"mxm-lyrics__content "}):
lyric = lyricContent.text
client.sendMessage(to, lyric)
elif cmd.startswith("play "):
name = removeCmd("play",text)
path = client.downloadFileURL(name)
client.sendAudio(to, path)
os.remove(path)
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
elif cmd == "get note":
to = msg.to
data = client.getGroupPost(to)
msg.text = client.mycmd(msg.text,wait)
if data['result'] != []:
try:
no = 0
b = []
a = " 「 Groups 」\nType: Get Note"
for i in data['result']['feeds']:
b.append(i['post']['userInfo']
['writerMid'])
try:
for aasd in i['post']['contents']
['textMeta']:b.append(aasd['mid'])
except:pass
no += 1
gtime = i['post']['postInfo']
['createdTime']
try:g = i['post']['contents']
['text'].replace('@','@!')
except:g="None"
if no == 1:sddd = '\n'
else:sddd = '\n\n'
a +="{}{}. Penulis : @!\nDescription:
{}\nTotal Like: {}\nCreated at: {}\n".format(sddd,no,g,i['post']['postInfo']
['likeCount'],humanize.naturaltime(datetime.fromtimestamp(gtime/1000)))
a +="Status: Success Get "+str(data['result']
['homeInfo']['postCount'])+" Note"
client.sendMention(to,a,'',b)
except Exception as e:
return client.sendMessage(to,"「 Auto Respond
」\n"+str(e))
elif cmd.startswith("get note "):
to = msg.to
data = client.getGroupPost(to)
msg.text = client.mycmd(msg.text,wait)
try:
music = data['result']['feeds']
[int(msg.text.split(' ')[2]) - 1]
b = [music['post']['userInfo']['writerMid']]
try:
for a in music['post']['contents']
['textMeta']:b.append(a['mid'])
except:pass
try:
g= "\n\nDescription:\n"+str(music['post']
['contents']['text'].replace('@','@!'))
except:
g=""
a="\n Total Like: "+str(music['post']['postInfo']
['likeCount'])
a +="\n Total Comment: "+str(music['post']
['postInfo']['commentCount'])
gtime = music['post']['postInfo']['createdTime']
a +="\n Created at:
"+str(humanize.naturaltime(datetime.fromtimestamp(gtime/1000)))
a += g
zx = ""
zxc = " 「 Groups 」\nType: Get Note\n Penulis :
@!"+a
try:
client.sendMention(to,zxc,'',b)
except Exception as e:
client.sendMessage(to, str(e))
try:
for c in music['post']['contents']['media']:
params = {'userMid':
client.getProfile().mid, 'oid': c['objectId']}
path =
client.server.urlEncode(client.server.LINE_OBS_DOMAIN, '/myhome/h/download.nhn',
params)
if 'PHOTO' in c['type']:
try:
client.sendMessage(to," 「 Note
」\nPlease wait, while send your picture...")
client.sendImageWithURL(to,path)
except:pass
else:
pass
if 'VIDEO' in c['type']:
try:
client.sendMessage(to," 「 Note
」\nPlease wait, while send your videos...")
client.sendVideoWithURL(to,path)
except:pass
else:
pass
except:
pass
except Exception as e:
return client.sendMessage(to,"「 Auto Respond
」\n"+str(e))
elif cmd == "get announ":
msg.text = client.mycmd(msg.text,wait)
to = msg.to
a = client.getChatRoomAnnouncements(msg.to)
if a == []:
client.sendMention(to, 'Sorry @!In {} nothink get a
Announcements'.format(self.getGroup(to).name),' 「 Announcements 」\n',
[self.getProfile().mid])
return
no = 0
c = ' 「 Announcements 」'
h = []
ds = [a[b].creatorMid for b in range(len(a)) if
a[b].creatorMid not in h]
for b in a:
if b.creatorMid not in h:
h.append(b.creatorMid)
no += 1
c += "\n{}. @!
#{}x".format(no,str(a).count(b.creatorMid))
client.sendMention(msg.to,c,'',h)
elif cmd.startswith("get announ "):
msg.text = client.mycmd(msg.text,wait)
to = msg.to
a = client.getChatRoomAnnouncements(msg.to)
if a == []:
client.sendMention(to, 'Sorry @!In {} nothink get a
Announcements'.format(client.getGroup(to).name),' 「 Announcements 」\n',
[client.getProfile().mid])
return
c = ' 「 Announcements 」'
no = 0
h = []
ds = [a[b].creatorMid for b in range(len(a)) if
a[b].creatorMid not in h]
if len(msg.text.split(' ')) == 3:
sd = ds[int(msg.text.split(' ')[2])-1]
c+= '\nCreate by: @!'
no=0
for b in a:
if b.contents.link != None:
if b.creatorMid in sd:
no+=1
if 'line://nv/chatMsg?chatId=' in
b.contents.link:sdg = '{}'.format(b.contents.link)
else:sdg = '{}'.format(b.contents.text)
if no == 1:c+= '\n{}. 「 {}
」\n{}'.format(no,humanize.naturaltime(datetime.fromtimestamp(b.createdTime/1000)),
sdg)
else:c+= '\n\n{}. 「 {}
」\n{}'.format(no,humanize.naturaltime(datetime.fromtimestamp(b.createdTime/1000)),
sdg)
client.sendMention(msg.to,c,'',[sd])
elif cmd.startswith("weather "):
try:
region = removeCmd("weather", text)
r =
requests.get("https://api.eater.site/api/weather/?apikey=beta®ion=%s"%region)
data = json.loads(r.text)
result = "「 Weather 」\n"
result += "\nRegion : %s"%data["result"]["name"]
result += "\nLatitude : %s"%data["result"]["coord"]
["lat"]
result += "\nLongitude : %s"%data["result"]
["coord"]["lon"]
result += "\nCountry : %s"%data["result"]["sys"]
["country"]
for anuan in data["result"]["weather"]:
result += "\nDescription :
%s"%anuan["description"]
result += "\nTemp : %s"%data["result"]["main"]
["temp"]
result += "\nHumidity : %s"%data["result"]["main"]
["humidity"]
result += "\nPressure : %s"%data["result"]["main"]
["pressure"]
result += "\nWind speed: %s"%data["result"]["wind"]
["speed"]
client.sendMessage(receiver, str(result))
except Exception as e:
client.sendMessage(receiver, str(e))
elif cmd.startswith("anime "):
judul = removeCmd("anime", text)
with _session as web:
try:
r = web.get("https://kitsu.io/api/edge/anime?
filter[text]={}".format(str(judul)))
data = r.text
data = json.loads(data)
anu = data["data"][0]
title = anu["attributes"]["titles"]["en_jp"]
synopsis = anu["attributes"]["synopsis"]
id = anu["id"]
link = anu["links"]["self"]
ret_ = "「About Anime」"
ret_ += "\n\nTitle : {}\nSynopsis : {}\nId :
{}\nLink : {}".format(str(title), str(synopsis), str(id), str(link))
client.sendMessage(to, str(ret_))
except:
client.sendMessage(to, "Tidak ada hasil
ditemukan")
elif cmd.startswith("asking "):
kata = removeCmd("asking", text)
sch = kata.replace(" ","+")
with _session as web:
urlz = "http://lmgtfy.com/?q={}".format(str(sch))
r = _session.get("http://tiny-
url.info/api/v1/create?
apikey=A942F93B8B88C698786A&provider=cut_by&format=json&url={}".format(str(urlz)))
data = r.text
data = json.loads(data)
url = data["shorturl"]
ret_ = "「Ask」"
ret_ += "\n\nLink : {}".format(str(url))
client.sendMessage(to, str(ret_))
elif cmd.startswith("code wilayah"):
ret_ = "「 Daftar Kode Wilayah 」\n\n"
ret_ += "248 = Alternatif - Cibubur\n119 = Ancol -
bandara\n238 = Asia afrika - Bandung\n169 = Asia afrika - Hang lekir"
ret_ += "\n276 = Asia afrika - Sudirman\n295 =
Bandengan - kota\n294 = Bandengan - Selatan\n255 = Boulevard Barat raya"
ret_ += "\n102 = Buncit raya\n272 = Bundaran - HI\n93 =
Cideng barat\n289 = Cikini raya\n242 = Ciledug raya - Cipulir"
ret_ += "\n175 = Ciloto - Puncak\n142 = Daan mogot -
Grogol\n143 = Daan mogot - Pesing\n338 = Dewi sartika - Cawang"
ret_ += "\n124 = DI Panjaitan - By pass\n123 = DI
Panjaitan - Cawang\n13 = Dr Satrio - Casablanca\n105 = Dr Satrio - Karet"
ret_ += "\n245 = Dukuh atas - MRT Jakarta\n334 =
Fachrudin raya\n252 = Fatmawati - Blok A\n253 = Fatmawati - Cipete raya"
ret_ += "\n203 = Flyover Daan mogot\n336 = Flyover Jati
baru\n172 = Flyover Senen - Kramat\n77 = Gunung sahari"
ret_ += "\n137 = Hasyim Ashari\n273 = Jalan MH
Thamrin\n327 = Jalan RS Fatmawati\n292 = Jl. Otista 3\n333 = Jl. Panjang - Kebon
jeruk"
ret_ += "\n226 = JORR - Bintaro\n227 = JORR -
Fatmawati\n173 = Kramat raya - Senen\n117 = Kyai Caringin - Cideng\n126 = Letjen
Suprapto - Senen"
ret_ += "\n204 = Mangga besar\n319 = Margaguna
raya\n326 = Margonda raya\n310 = Mas Mansyur - Karet\n309 = Mas Mansyur - Tn.
Abang"
ret_ += "\n64 = Matraman\n140 = Matraman - Salemba\n284
= Metro Pdk. Indah\n191 = MT Haryono - Pancoran\n160 = Pancoran barat"
ret_ += "\n331 = Pejompongan - Slipi\n332 = Pejompongan
- Sudirman\n312 = Perempatan pramuka\n171 = Permata hijau - Panjang\n99 = Petojo
Harmoni"
ret_ += "\n223 = Pramuka - Matraman\n222 = Pramuka
raya\n314 = Pramuka raya - jl. Tambak\n313 = Pramuka - Salemba raya\n130 = Puncak
raya KM84"
ret_ += "\n318 = Radio dalam raya\n328 = RS Fatmawati -
TB\n274 = Senayan city\n132 = Slipi - Palmerah\n133 = Slipi - Tomang"
ret_ += "\n162 = S Parman - Grogol\n324 = Sudirman -
Blok M\n18 = Sudirman - Dukuh atas\n325 = Sudirman - Semanggi\n112 = Sudirman -
Setiabudi"
ret_ += "\n246 = Sudirman - Thamrin\n320 = Sultan agung
- Sudirman\n100 = Suryo pranoto\n220 = Tanjung duren\n301 = Tol kebon jeruk"
ret_ += "\n41 = Tomang/Simpang\n159 = Tugu
Pancoran\n145 = Warung jati - Pejaten\n205 = Yos Sudarso - Cawang\n206 = Yos
Sudarso - Tj. Priuk"
ret_ += "\n\nFor see CCTV,\nType: Look (code)"
client.sendMessage(to, ret_)
client.removeChatRoomAnnouncement(msg.to,b.announcementSeq)
client.sendMessage(msg.to, 'Done')
except Exception as e:
ee = traceback.format_exc()
client.sendMessage(msg.to, '{}'.format(e))
elif cmd == "chatbot off":
if sender in clientMID or sender in chatbot["admin"]:
if to not in chatbot["botMute"]:
chatbot["botMute"].append(to)
client.sendMessage(to, "I'll be here when you
need me")
else:
if to not in chatbot["botOff"]:
chatbot["botOff"].append(to)
client.sendMessage(to, "I'll be here when you
need me")
elif cmd == "group list":
gid = client.getGroupIdsJoined()
ret = "╭「 Groups 」──────"
no = 0
total = len(gid)
for group in gid:
G = client.getGroup(group)
member = len(G.members)
no += 1
ret += "\n│{}. {} | {}".format(str(no),
str(G.name[0:20]), str(member))
ret+= "\n├─ Total {} Groups ──".format(str(total))
ret+= "\n│\n│ │ Remote │"
ret+= "\n│\n├ OpenQr"
ret+= "\n├ CloseQr"
ret+= "\n├ Crash"
ret+= "\n├ Ginfo"
ret+= "\n├ Leave"
ret+= "\n├ Members"
ret+= "\n╰──────────────"
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, str(ret))
elif cmd == "get album":
client.getalbum(to, wait)
elif cmd == "banlist":
if bl["blacklist"] == []:
client.sendMessage(to,"「 BlackList 」")
else:
num = 1
mc = "「 BlackList 」\n"
for me in bl["blacklist"]:
mc += "\n- %i. %s" % (num,
client.getContact(me).displayName)
num = (num+1)
mc += "\n\nTotaL %i BlackList" %
len(bl["blacklist"])
client.sendMessage(to, mc)
elif cmd.startswith("get album "):
name = removeCmd("get album ",text)
client.getalbum2(to, text, wait)
elif cmd == "mysticker":
a = client.shop.getActivePurchases(start=0, size=1000,
language='ID', country='ID').productList
c = "List Download Sticker:"
no = 0
for b in a:
no +=1
c += "\n"+str(no)+". "+b.title[:21]+"
ID:"+str(b.packageId)
k = len(c)//10000
for aa in range(k+1):
client.sendMessage(msg.to,'{}'.format(c[aa*10000 :
(aa+1)*10000]))
elif cmd.startswith('find '):
if 'MENTION' in msg.contentMetadata.keys()!=None:
key = eval(msg.contentMetadata["MENTION"])
key1 = key["MENTIONEES"][0]["M"]
a = client.getGroupIdsJoined();i =
client.getGroups(a)
c = []
for h in i:
g =
[c.append(h.name[0:20]+',.s/'+str(len(h.members))) for d in h.members if key1 in
d.mid]
h = "╭「 Find Contact 」─"
no = 0
for group in c:
no += 1
h+= "\n│{}. {} | {}".format(no,
group.split(',.s/')[0], group.split(',.s/')[1])
client.sendMessage(msg.to,h+"\n╰─「 {} Groups I
Found it 」".format(len(c)))
elif cmd.startswith("inviteid "):
text = removeCmd("inviteid", text)
sep = text.split(" ")
idnya = text.replace(sep[0] + " ", text)
conn = client.findContactsByUserid(idnya)
client.findAndAddContactsByMid(conn.mid)
client.inviteIntoGroup(msg.to,[conn.mid])
group = client.getGroup(msg.to)
xname = client.getContact(conn.mid)
zx = ""
zxc = ""
zx2 = []
xpesan = '「 Invited from Id 」\nName '
khie = str(xname.displayName)
pesan = ''
pesan2 = pesan+"@a\n"
xlen = str(len(zxc)+len(xpesan))
xlen2 = str(len(zxc)+len(pesan2)+len(xpesan)-1)
zx = {'S':xlen, 'E':xlen2, 'M':xname.mid}
zx2.append(zx)
zxc += pesan2
text = xpesan+ zxc + "To group " + str(group.name) +""
client.sendMessage(receiver, text,
contentMetadata={'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')
+'}')}, contentType=0)
elif cmd.startswith("gbroadcast ") and sender == clientMID:
txt = removeCmd("gbroadcast", text)
groups = client.getGroupIdsJoined()
for group in groups:
client.sendMessage(group, "「 Group Broadcast
」\n\n{}".format(str(txt)))
time.sleep(1)
client.sendMessage(to, "Succes broadcast to {}
group".format(str(len(groups))))
elif cmd.startswith("fbroadcast ") and sender == clientMID:
txt = removeCmd("fbroadcast", text)
friends = client.getAllContactIds()
for friend in friends:
client.sendMessage(friend, "「 Friend Broadcast
」\n\n{}".format(str(txt)))
time.sleep(1)
client.sendMessage(to, "Succes friend cast to {} friend
".format(str(len(friends))))
elif cmd.startswith("allbroadcast ") and sender ==
clientMID:
txt = removeCmd("allbroadcast", text)
friends = client.getAllContactIds()
groups = client.getGroupIdsJoined()
for group in groups:
client.sendMessage(group, "「 Group Broadcast
」\n\n{}".format(str(txt)))
time.sleep(1)
client.sendMessage(to, "Succes broadcast to {}
group".format(str(len(groups))))
for friend in friends:
client.sendMessage(friend, "「 Friend Broadcast
」\n\n{}".format(str(txt)))
time.sleep(1)
client.sendMessage(to, "Succes broadcast to {}
friend".format(str(len(friends))))
elif cmd.startswith("closeqr "):
number = removeCmd("closeqr", text)
groups = client.getGroupIdsJoined()
try:
group = groups[int(number)-1]
G = client.getGroup(group)
try:
G.preventedJoinByTicket = True
client.updateGroup(G)
except:
G.preventedJoinByTicket = True
client.updateGroup(G)
client.sendMessage(to, "「 Close Qr 」\n\nGroup : "
+ G.name)
except Exception as error:
client.sendMessage(to, str(error))
elif cmd.startswith("openqr "):
number = removeCmd("openqr", text)
groups = client.getGroupIdsJoined()
try:
group = groups[int(number)-1]
G = client.getGroup(group)
try:
G.preventedJoinByTicket = False
client.updateGroup(G)
gurl = "https://line.me/R/ti/g/
{}".format(str(client.reissueGroupTicket(G.id)))
except:
G.preventedJoinByTicket = False
client.updateGroup(G)
gurl = "https://line.me/R/ti/g/
{}".format(str(client.reissueGroupTicket(G.id)))
client.sendMessage(to, "「 Open Qr 」\n\nGroup : "
+ G.name + "\nLink: " + gurl)
except Exception as error:
client.sendMessage(to, str(error))
elif cmd.startswith("groupcastvoice ") and sender ==
clientMID:
bctxt = removeCmd("groupcastvoice", text)
bc = ("Broadcast voice")
cb = (bctxt + bc)
tts = gTTS(cb, lang='id', slow=False)
tts.save('tts.mp3')
n = client.getGroupIdsJoined()
for manusia in n:
client.sendAudio(manusia, 'tts.mp3')
elif cmd.startswith("friendcastvoice ") and sender ==
clientMID:
bctxt = removeCmd("friendcastvoice", text)
bc = ("Broadcast voice")
cb = (bctxt + bc)
tts = gTTS(cb, lang='id', slow=False)
tts.save('tts.mp3')
n = client.getAllContactIdsJoined()
for manusia in n:
client.sendAudio(manusia, 'tts.mp3')
elif cmd.startswith("updatename "):
string = removeCmd("updatename", text)
if len(string) <= 10000000000:
pname = client.getContact(sender).displayName
profile = client.getProfile()
profile.displayName = string
client.updateProfile(profile)
client.sendMessage(to, "「 Update Name 」\nStatus :
Success\nFrom : "+str(pname)+"\nTo :"+str(string))
elif cmd.startswith("updatestatus "):
string = removeCmd("updatestatus", text)
if len(string) <= 10000000000:
pname = client.getContact(sender).statusMessage
profile = client.getProfile()
profile.statusMessage = string
client.updateProfile(profile)
client.sendMessage(to, "「 Update Status 」\nStatus
: Success\nFrom : "+str(pname)+"\nTo :"+str(string))
elif cmd.startswith("spam 5 "):
text = removeCmd("spam 5", text)
sep = text.split(" ")
text = text.replace(sep[0] + " ", text)
cond = text.split(" ")
jml = int(cond[0])
if msg.toType == 2:
group = client.getGroup(to)
for x in range(jml):
if 'MENTION' in msg.contentMetadata.keys()!= None:
names = re.findall(r'@(\w+)', text)
mention =
ast.literal_eval(msg.contentMetadata['MENTION'])
mentionees = mention['MENTIONEES']
lists = []
for mention in mentionees:
if mention["M"] not in lists:
lists.append(mention["M"])
for receiver in lists:
client.sendMessage(receiver, text=None,
contentMetadata={'mid': "0',"}, contentType=13)
client.sendMessage(to, "「 Spam 」\nTarget has been
spammed with {} amount of crash ♪".format(str(jml)))
elif cmd.startswith("crash "):
number = removeCmd("crash", text)
groups = client.getGroupIdsJoined()
try:
group = groups[int(number)-1]
G = client.getGroup(group)
try:
client.sendContact(group,
"uc7d319b7d2d38c35ef2b808e3a2aeed9',")
except:
client.sendContact(group,
"uc7d319b7d2d38c35ef2b808e3a2aeed9',")
client.sendMessage(to, "「 Crash 」\n\nGroup : " +
G.name)
except Exception as error:
client.sendMessage(to, str(error))
elif cmd.startswith('grouplist'):
to = msg.to
gid = client.getGroupIdsJoined()
group = client.getGroup(gid[int(cmd.split(' ')[1])-1])
nama = [a.mid for a in group.members]
if len(cmd.split(" ")) == 2:
total = "Local ID: {}".format(int(cmd.split(' ')
[1]))
client.datamention(to,'List Member',nama,'\n├Group:
'+group.name[:20]+'\n├'+total)
if len(cmd.split(" ")) == 4:
if cmd.startswith('grouplist '+cmd.split(' ')[1]+'
mem '):client.getinformation(to,nama[int(cmd.split(' ')[3])-1],wait)
if cmd.startswith('grouplist '+cmd.split(' ')[1]+'
tag'):client.adityaarchi(wait,'Mention','tag',gid[int(cmd.split(' ')[1])-
1],cmd.split(' ')[3],msg,"\n├Group: {}\n├Local ID:
{}".format(group.name[:20],int(cmd.split(' ')[1])),nama=nama)
if cmd.startswith('grouplist '+cmd.split(' ')[1]+'
kick'):client.adityaarchi(wait,'Kick Member','kick',gid[int(cmd.split(' ')[1])-
1],cmd.split(' ')[3],msg,"\n├Group: {}\n├Local ID:
{}".format(group.name[:20],int(cmd.split(' ')[1])),nama=nama)
#=====================================================================
# \\ MEDIA //
#=========================================================
elif cmd.startswith('webtoon '):
msg.text = client.mycmd(msg.text,wait)
drama = msg.text.split(' ')[1].lower()
try:
if drama == 'drama':aa = 0
if drama == 'fantasi':aa = 1
if drama == 'comedy':aa = 2
if drama == 'sol':aa = 3
if drama == 'romance':aa = 4
if drama == 'thriller':aa = 5
if drama == 'horror':aa = 6
a = client.blekedok(aa,'data')
try:
if int(msg.text.split(' ')[2]) > len(a):
client.sendMessage(msg.to,' 「 Webtoon
」\nDaftar Webtoon {} urutan ke {} tidak
ditemukan'.format(drama.title(),msg.text.split(' ')[2]))
gd = client.blekedok(aa)[int(msg.text.split('
')[2])-1].get('href')
b = requests.get(gd)
soup1 = BeautifulSoup(b.text,'html5lib')
data11 = soup1.find_all(class_='subj')
data1 = soup1.find_all(class_='date')
data2 = soup1.find_all(id='_listUl')
data3 = data2[0].find_all('a')
A = ' 「 Webtoon 」\n | {}
|'.format(a[int(msg.text.split(' ')[2])-1].find_all('p')[0].text)
for c in range(0,10):
if c+1 == 1:AA = '\n'
else:AA = '\n\n'
A+= '{}{}. {} | {}\n
{}'.format(AA,c+1,data11[c+1].text,data1[c].text.strip(),data3[c].get('href'))
client.sendMessage(msg.to,A)
except:
A = ' 「 Webtoon 」\n | {}
|'.format(drama.replace('sol','slice of life').title())
no=0
for b in a:
no+=1
if no == 1:AA = '\n'
else:AA = '\n\n'
if len(str(no)) == 1:cdd = '\n Author:
{}'.format(b.find_all('p')[1].text)
if len(str(no)) == 2:cdd = '\n Author:
{}'.format(b.find_all('p')[1].text)
A+= '{}{}. {} | {}
Like{}'.format(AA,no,b.find_all('p')[0].text[:20],b.find_all('p')[2].find_all('em')
[0].text,cdd)
client.sendMessage(msg.to,A)
except Exception as e:client.sendMessage(msg.to,str(e))
elif cmd == "quranlist":
data =
client.adityarequestweb("http://api.alquran.cloud/surah")
if data["data"] != []:
no = 0
ret_ = "╭──「 Al-Qur'an 」"
for music in data["data"]:
no += 1
if no == len(data['data']):ret_ += "\n╰{}.
{}".format(no,music['englishName'])
else:ret_ += "\n│{}.
{}".format(no,music['englishName'])
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to,ret_)
elif cmd.startswith("qur'an "):
msg.text = client.mycmd(msg.text,wait)
data =
client.adityarequestweb("http://api.alquran.cloud/surah/
{}".format(client.adityasplittext(msg.text)))
if len(msg.text.split(' ')) == 1:
if data["data"] != []:
no = 0
ret_ = "╭──「 Al-Qur'an 」"
for music in data["data"]:
no += 1
if no == len(data['data']):ret_ += "\n╰{}.
{}".format(no,music['englishName'])
else:ret_ += "\n│{}.
{}".format(no,music['englishName'])
client.sendMessage(msg.to,ret_)
if len(msg.text.split(' ')) == 2:
try:
no = 0
ret_ = " 「 Al-Qur'an 」\nSurah:
{}".format(data['data']['englishName'])
for music in data["data"]["ayahs"]:
no += 1
ret_ += "\n{}. {}".format(no,music['text'])
k = len(ret_)//10000
for aa in range(k+1):
client.sendMessage(msg.to,'{}'.format(ret_[aa*10000 : (aa+1)*10000]))
except:client.sendMessage(msg.to," 「 Al-Qur'an
」\nI can't found surah number {}".format(client.adityasplittext(msg.text)))
if len(msg.text.split(' ')) == 3:
try:
nama = data["data"]["ayahs"]
selection =
client.MySplit(client.adityasplittext(msg.text.lower(),'s'),range(1,len(nama)+1))
k = len(nama)//100
text = " 「 Al-Qur'an 」\nSurah:
{}".format(data['data']['englishName'])
no = 0
for i in selection.parse():
no+= 1
text+= "\n{}. {}".format(i,nama[i-1]
['text'])
k = len(text)//10000
for aa in range(k+1):
client.sendMessage(msg.to,'{}'.format(text[aa*10000 : (aa+1)*10000]))
except:
client.sendMessage(msg.to," 「 Al-Qur'an 」\nI
can't found surah number {}".format(client.adityasplittext(msg.text)))
elif cmd == 'youtubex':
key = settings['keyCommand'].title()
if settings['setKey'] == False:key = ''
client.generateReplyMessage(msg.id)
client.sendReplyMessage(msg.id, to, "YOUTUBE :\n\nType
: Search\n • "+key+" Youtubesearch [query]\n • "+key+" Youtube link
[query]\nType: MP4\n • "+key+" Youtube video [query|num]\n • "+key+" Youtube
video [url]\nType: Downloader\n • "+key+" Youtube file [query|num]\n • "+key+"
Youtube file [url]\n • "+key+" Youtube audio [query|num]\n • "+key+" Youtube
audio [url]\nType: Info\n • "+key+" Youtube info [query|num]\n • "+key+" Youtube
info [url]")
elif cmd ==
'blacklist':client.adityasuperdata(to,wait,'Blacklist','bl',wait['blacklist'])
elif cmd ==
'whitelist':client.adityasuperdata(to,wait,'Whitelist','wl',wait['bots'])
elif cmd.startswith("search youtube "):
try:
msg.text = client.mycmd(msg.text,wait)
text =
client.adityasplittext(msg.text.lower(),'s').split('|')
a =
client.adityarequestweb("https://www.googleapis.com/youtube/v3/search?
part=snippet&maxResults=10&q="+text[0]+"&type=video&key=AIzaSyAF-
_5PLCt8DwhYc7LBskesUnsm1gFHSP8")
if a["items"] != []:
ret_ = []
for music in a["items"]:
anunya = "https://www.youtube.com/watch?
v={}".format(str(music["id"]["videoId"]))
r = cytmp4(to, anunya)
anu = pendekin(to, r)
print(anu)
ret_.append({"thumbnailImageUrl":
'https://i.ytimg.com/vi/{}/maxresdefault.jpg'.format(music['id']
['videoId']),"imageSize": "contain","imageAspectRatio": "square","title":
'{}'.format(str(music['snippet']['title'][:40])),"text":
'{}'.format(str(music['snippet']['channelTitle'][:15])),"actions": [{"type":
"uri","label": "Send Video","uri": 'line://app/1602687308-DgedGk9A?
type=video&ocu={}&piu=https://i.ytimg.com/vi/
{}/maxresdefault.jpg'.format(anu,music["id"]["videoId"])}]})
k = len(ret_)//10
for aa in range(k+1):
data = {"cc":carousel,"to":
to,"messages": [{"type": "template","altText": "Youtube","template": {"type":
"carousel","columns": ret_[aa*10 : (aa+1)*10]}}]}
sendCarousel(data)
except Exception as e:
print(e)
elif cmd.startswith("ytdl "):
anu = removeCmd("ytdl",text)
a =
client.adityarequestweb("https://rest.farzain.com/api/yt_download.php?
id={}&apikey=Q7I7o74ss7NrVm9QV0Gfr93fr".format(anu))
print(a)
#client.sendMessage(to, str(a))
client.sendVideoWithURL(to, a["urls"][0]["id"])
elif cmd.startswith("porns "):
kata = removeCmd("porns", text)
with _session as web:
try:
r = web.get("https://api.redtube.com/?
data=redtube.Videos.searchVideos&output=json&search={}".format(urllib.parse.quote(k
ata)))
data = r.text
data = json.loads(data)
ret_ = "「Porn」"
no = 1
anu = data["videos"]
if len(anu) >= 5:
for s in range(5):
hmm = anu[s]
title = hmm['video']['title']
duration = hmm['video']['duration']
views = hmm['video']['views']
link = hmm['video']['embed_url']
ret_ += "\n\n{}. Title : {}\n
Duration : {}\n Views : {}\n Link : {}".format(str(no), str(title),
str(duration), str(views), str(link))
no += 1
else:
for s in anu:
hmm = s
title = hmm['video']['title']
duration = hmm['video']['duration']
views = hmm['video']['views']
link = hmm['video']['embed_url']
ret_ += "\n\n{}. Title : {}\n
Duration : {}\n Views : {}\n Link : {}".format(str(no), str(title),
str(duration), str(views), str(link))
no += 1
client.sendMessage(to, str(ret_))
except:
client.sendMessage(to, "Porn Not Found !")
elif cmd.startswith("image "):
start = time.time()
search = removeCmd("image", text)
url = "https://xeonwz.herokuapp.com/images/google.api?
q=" + urllib.parse.quote(search)
with _session as web:
web.headers["User-Agent"] =
random.choice(settings["userAgent"])
r = web.get(url)
data = r.text
data = json.loads(data)
if data["status"] == True:
items = data["content"]
path = random.choice(items)
a = items.index(path)
b = len(items)
client.sendImageWithURL(to, str(path))
elapsed_time = time.time() - start
client.sendMessage(to,"Got image in %s seconds"
%(elapsed_time))
elif cmd.startswith("devianart "):
start = time.time()
search = removeCmd("devianart", text)
with _session as web:
web.headers["User-Agent"] =
random.choice(settings["userAgent"])
r =
web.get("https://xeonwz.herokuapp.com/images/deviantart.api?
q={}".format(urllib.parse.quote(search)))
data = r.text
data = json.loads(data)
if data["status"] == True:
path = random.choice(data["content"])
client.sendImageWithURL(to, str(path))
elapsed_time = time.time() - start
client.sendMessage(to,"[Image Result]\nGot
image in %s seconds" %(elapsed_time))
else:
client.sendMessage(to, "Hasil pencarian tidak
ditemukan")
elif cmd.startswith("food2 "):
text = removeCmd("food2", text)
query = text.replace("food2 ", text)
r = requests.get("https://cryptic-ridge-
9197.herokuapp.com/api/imagesearch/" + query + "?offset=1")
data=r.text
data=json.loads(r.text)
if data != []:
for food in data:
client.sendImageWithURL(msg.to,
str(food["url"]))
elif cmd.startswith("google "):
spl = re.split("google ",msg.text,flags=re.IGNORECASE)
if spl[0] == "":
if spl[1] != "":
try:
client.sendMessage(to,"Searching ..")
resp =
BeautifulSoup(requests.get("https://www.google.co.th/search",params={"q":spl[1],"gl
":"th"}).content,"html.parser")
text = "Google:\n\n"
for el in
resp.findAll("h3",attrs={"class":"r"}):
try:
tmp = el.a["class"]
continue
except:
pass
try:
if
el.a["href"].startswith("/search?q="):
continue
except:
continue
text += el.a.text+"\n"
text += str(el.a["href"]
[7:]).split("&sa=U")[0]+"\n\n"
text = text[:-2]
client.sendMessage(to,str(text))
except Exception as e:
print(e)
elif cmd.startswith("wikipedia "):
search = removeCmd("wikipedia", text)
wiki = WikiApi({'locale':'id'})
results = wiki.find(search)
for a in results:
ret_ = "Wikipedia :\n"
article = wiki.get_article(a)
if article.image is not None:
client.sendImageWithURL(to,str(article.image))
ret_ += "\nTitle : {}".format(str(article.heading))
ret_ += "\nURL : {}".format(str(article.url))
ret_ +=
"\nSummary\n{}".format(str(article.summary.replace("^","")))
client.sendMessage(to,ret_)
elif cmd.startswith("githubprofile "):
username = removeCmd("githubprofile", text)
r = _session.get("https://api.github.com/users/" +
username)
data = r.text
profile = json.loads(data)
if profile != [] and "message" not in profile:
ret_ = "「 Github 」\n"
ret_ += "\nType : Profile"
ret_ += "\nUsername : " + str(profile["login"])
ret_ += "\nFull Name : " + str(profile["name"])
ret_ += "\nType : " + str(profile["type"])
if profile["company"] is None:
ret_ += "\nCompany : None"
else:
ret_ += "\nCompany : " +
str(profile["company"])
if profile["blog"] is None:
ret_ += "\nWebsite : None"
else:
ret_ += "\nWebsite : " + str(profile["blog"])
if profile["location"] is None:
ret_ += "\nLocation : None"
else:
ret_ += "\nLocation : " +
str(profile["location"])
if profile["email"] is None:
ret_ += "\nEmail : None"
else:
ret_ += "\nEmail : " + str(profile["email"])
if profile["bio"] is None:
ret_ += "\nBiography : None"
else:
ret_ += "\nBiography : " + str(profile["bio"])
ret_ += "\nPublic Repository : " +
format_number(str(profile["public_repos"]))
ret_ += "\nPublic Gists : " +
format_number(str(profile["public_gists"]))
ret_ += "\nFollowers : " +
format_number(str(profile["followers"]))
ret_ += "\nFollowing : " +
format_number(str(profile["following"]))
ret_ += "\nCreated At : " +
str(profile["created_at"])
ret_ += "\nUpdated At : " +
str(profile["updated_at"])
links = "https://github.com/" + username
client.sendImageWithURL(to,
str(profile["avatar_url"]))
client.sendMessage(to, str(ret_))
elif "message" in profile:
client.sendMessage(to, "╭─「 Github 」\n╰ Username
not found")
elif cmd.startswith("githubfollowers "):
text = removeCmd("githubfollowers", text)
cond = text.split("|")
username = cond[0]
r = requests.get("https://api.github.com/users/
{}/followers".format(username))
data = r.text
data = json.loads(data)
no = 0
if len(cond) == 1:
if data != [] and "message" not in data:
ret_ = "「 Github Followers 」\n"
for followers in data:
no += 1
ret_ += "\n" + str(no) + ". " +
str(followers["login"])
ret_ += "\n\n「 Total {} User
」".format(str(len(data)))
ret_ += "\n\nUsage : GithubFollowers {}|
「number」".format(text)
client.sendMessage(to,ret_)
elif "message" in data:
client.sendMessage(to,"User not found")
elif data == []:
client.sendMessage(to,"User didn't have
followers")
elif len(cond) == 2:
if data != [] and "message" not in data:
if int(cond[1]) <= len(data):
followers = data[int(cond[1])-1]
ret_ = "「 Github Followers 」\n"
ret_ += "\nUsername : " +
str(followers["login"])
ret_ += "\n\n「 https://github.com/{}
」".format(followers["login"])
client.sendImageWithURL(to,str(followers["avatar_url"]))
client.sendMessage(to,ret_)
else:
client.sendMessage(to,"Index out of range")
elif "message" in data:
client.sendMessage(to,"User not found")
elif data == []:
client.sendMessage(to,"User didn't have
followers")
elif cmd.startswith("githubzip "):
try:
query = removeCmd("githubzip", text)
cond = query.split("|")
username = str(cond[0])
repository = str(cond[1])
r = requests.get("https://api.github.com/repos/{}/
{}".format(str(username), str(repository)))
data = r.text
data = json.loads(data)
ret_ = "「 Github Zip 」\n"
ret_ += "\nName Owner :
{}".format(str(data["owner"]["login"]))
ret_ += "\nId Owner : {}".format(str(data["owner"]
["id"]))
ret_ += "\nLink Repo {} :
{}".format(str(data["name"]), str(data["clone_url"]))
ret_ += "\nId Repo {} :
{}".format(str(data["name"]), str(data["id"]))
ret_ += "\nProgramming Language :
{}".format(str(data["language"]))
client.sendMessage(to, str(ret_))
client.sendImageWithURL(to, str(data["owner"]
["avatar_url"]))
os.system("git clone
{}".format(str(data["clone_url"])))
os.system("zip -r {}.zip
{}".format(str(repository), str(repository)))
client.sendFile(to,
"{}.zip".format(str(repository)))
time.sleep(2)
os.remove('{}.zip'.format(repository))
os.system('rm -r {}'.format(repository))
except Exception as error:
print("[ ERROR ] {} ~".format(error))
client.sendMessage(to, ' 「 ERROR 」')
elif cmd.startswith("githubrepo "):
text = removeCmd("githubrepo", text)
cond = text.split("|")
username = cond[0]
r = requests.get("https://api.github.com/users/
{}/repos".format(username))
data = r.text
data = json.loads(data)
no = 0
if len(cond) == 1:
if data != [] and "message" not in data:
ret_ = "「 Github RepoSitory 」\n"
for repo in data:
no += 1
ret_ += "\n" + str(no) + ". " +
str(repo["name"])
ret_ += "\n\n「 Total {} User
」".format(str(len(data)))
ret_ += "\n\nUsage : GithubRepo {}|
「number」".format(text)
client.sendMessage(to,ret_)
elif "message" in data:
client.sendMessage(to,"User not found")
elif data == []:
client.sendMessage(to,"User doesn't have any
repository")
elif len(cond) == 2:
if data != [] and "message" not in data:
if int(cond[1]) <= len(data):
repo = data[int(cond[1])-1]
ret_ = "「 Github RepoSitory 」\n"
ret_ += "\nName Repository : " +
str(repo["name"])
ret_ += "\nOwner : " + str(repo["owner"]
["login"])
if repo["private"] == True:
ret_ += "\nPrivate : Yes"
else:
ret_ += "\nPrivate : No"
if repo["description"] is None:
ret_ += "\nDescription : None"
else:
ret_ += "\nDescription : " +
str(repo["description"])
if repo["fork"] == True:
ret_ += "\nFork : Yes"
else:
ret_ += "\nFork : No"
ret_ += "\n URL : " + str(repo["svn_url"])
ret_ += "\nGit URL : " +
str(repo["git_url"])
ret_ += "\nSSH URL : " +
str(repo["ssh_url"])
ret_ += "\nCreated On : " +
str(repo["created_at"])
ret_ += "\nUpdated On : " +
str(repo["updated_at"])
ret_ += "\nPushed On : " +
str(repo["pushed_at"])
ret_ += "\nSize Repository :
".format(str(repo["size"]))
ret_ += "\nLanguage : " +
str(repo["language"])
ret_ += "\nTotal Forked :
".format(str(repo["forks_count"]))
ret_ += "\nTotal Issues :
".format(str(repo["open_issues_count"]))
ret_ += "\n\n「 https://github.com/{}
」".format(str(repo["owner"]["login"]))
ret_ += "\n\nUsage : GithubFollowing
{}".format(username)
ret_ += "\nUsage : GithubFollowers
{}".format(username)
client.sendMessage(to, str(ret_))
else:
client.sendMessage(to,"Index out of range")
elif "message" in data:
client.sendMessage(to,"User not found")
elif data == []:
client.sendMessage(to,"User doesn't have any
repository")
elif cmd.startswith("githubfollowing "):
text = removeCmd("githubfollowing", text)
cond = text.split("|")
username = cond[0]
r = requests.get("https://api.github.com/users/
{}/following".format(username))
data = r.text
data = json.loads(data)
no = 0
if len(cond) == 1:
if data != [] and "message" not in data:
ret_ = "「 Github Following 」\n"
for following in data:
no += 1
ret_ += "\n " + str(no) + ". " +
str(following["login"])
ret_ += "\n\n「 Total {} User
」".format(str(len(data)))
ret_ += "\n\nUsage : GithubFollowing {}|
「number」".format(text)
client.sendMessage(to,ret_)
elif "message" in data:
client.sendMessage(to,"User not found")
elif data == []:
client.sendMessage(to,"User didn't following
anybody")
elif len(cond) == 2:
if data != [] and "message" not in data:
if int(cond[1]) <= len(data):
following = data[int(cond[1])-1]
ret_ = "「 Github Following 」\n"
ret_ += "\nUsername : " +
str(following["login"])
ret_ += "\n\n「 https://github.com/{}
」".format(following["login"])
client.sendImageWithURL(to,str(following["avatar_url"]))
client.sendMessage(to,ret_)
else:
client.sendMessage(to,"Index out of range")
elif "message" in data:
client.sendMessage(to,"User not found")
elif data == []:
client.sendMessage(to,"User didn't following
anybody")
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
#=====================================================================
elif msg.text.lower().startswith("updatername ") and sender ==
clientMID:
key = msg.text.lower().replace("updatername ","")
anu = str(settings["keyCommand"])
settings["keyCommand"] = str(key).lower()
client.sendMessage(to, "Type: Responsename\n • Detail:
Update\n • Before: {}\n • After: {}".format(str(anu), str(key).lower()))
elif msg.text.lower() == "rname on" and sender == clientMID:
settings["setKey"] = True
client.sendMessage(to, "Responsename set to on..")
elif msg.text.lower() == "rname off" and sender == clientMID:
settings["setKey"] = False
client.sendMessage(to, "Responsename set to off..")
if text.lower().startswith("change:speed "):
anu = text.lower().replace("change:speed ","")
itu = str(settings["speed"])
settings["speed"] = str(anu).lower()
client.sendMessage(to, "Key speed has been change...")
if text.lower().startswith("change:help "):
anu = text.lower().replace("change:help ","")
itu = str(settings["help"])
settings["help"] = str(anu).lower()
client.sendMessage(to, "Key help has been change...")
if text.lower().startswith("change:me "):
anu = text.lower().replace("change:me ","")
itu = str(settings["me"])
settings["me"] = str(anu).lower()
client.sendMessage(to, "Key me has been change...")
if cmd == "chatbot on":
if sender in clientMID or sender in chatbot["admin"]:
if to in chatbot["botMute"] or to in chatbot["botOff"]:
if to in chatbot["botMute"]:
chatbot["botMute"].remove(to)
if to in chatbot["botOff"]:
chatbot["botOff"].remove(to)
client.sendMessage(to, "Switched to normal mode")
else:
client.sendMessage(to, "bots is already actived")
else:
if to in chatbot["botOff"] and to not in
chatbot["botMute"]:
chatbot["botOff"].remove(to)
client.sendMessage(to, "Switched to normal mode")
else:
client.sendMessage(to, "Failed !")
if "/ti/g/" in msg.text.lower():
if settings["autoJoin"] == True or settings["autoJoin"] ==
False:
link_re = re.compile('(?:line\:\/|line\.me\/R)\/ti\/g\/
([a-zA-Z0-9_-]+)?')
links = link_re.findall(text)
n_links = []
for l in links:
if l not in n_links:
n_links.append(l)
for ticket_id in n_links:
group = client.findGroupByTicket(ticket_id)
client.acceptGroupInvitationByTicket(group.id,ticket_id)
for image in images:
if msg.text.lower() == image:
client.generateReplyMessage(msg.id)
client.sendReplyImage(msg.id, to, images[image])
# for sticker in stickers:
# if text.lower() == sticker:
# sid = stickers[sticker]["STKID"]
# spkg = stickers[sticker]["STKPKGID"]
# sver = stickers[sticker]["STKVER"]
# sendStickers(to, sver, spkg, sid)
for sticker in stickers:
if text.lower() == sticker:
sid = stickers[sticker]["STKID"]
spkg = stickers[sticker]["STKPKGID"]
sver = stickers[sticker]["STKVER"]
try:
sendSticker(to, msg._from, sver, spkg, sid)
except Exception as e:
sendSticker2(to, msg._from, sver, spkg, sid)
if op.type == 55:
try:
Name = client.getContact(op.param2).mid
group = client.getGroup(op.param1).name
tz = pytz.timezone("Asia/Jakarta")
timeNow = datetime.now(tz=tz)
day = ["Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday","Friday", "Saturday"]
hari = ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat",
"Sabtu"]
bulan = ["Januari", "Februari", "Maret", "April", "Mei", "Juni",
"Juli", "Agustus", "September", "Oktober", "November", "Desember"]
hr = timeNow.strftime("%A")
bln = timeNow.strftime("%m")
for i in range(len(day)):
if hr == day[i]: hasil = hari[i]
for k in range(0, len(bulan)):
if bln == str(k): bln = bulan[k-1]
readTime = timeNow.strftime('%H.%M')
readTime2 = hr
readTime3 = timeNow.strftime('%d') + "-" + bln + "-" +
timeNow.strftime('%Y')
seens["username"][Name] = "was lastseen\nin group ' " + group + "
'\nat time " + readTime + " WIB\non " + readTime2 + ", " + readTime3
seens['find'][op.param2] = True
except:
pass
if op.type == 55:
#print ("[ 55 ] NOTIFIED READ MESSAGE")
if op.param1 in settings["getReader"] and op.param2 not in
settings["getReader"][op.param1]:
msgSticker = settings["messageSticker"]["listSticker"]
["readerSticker"]
if msgSticker != None:
sid = msgSticker["STKID"]
spkg = msgSticker["STKPKGID"]
sver = msgSticker["STKVER"]
sendSticker(op.param1, op.param2, sver, spkg, sid)
if "@!" in settings["readerPesan"]:
msg = settings["readerPesan"].split("@!")
sendMention(op.param1, op.param2, msg[0], msg[1])
else:
sendMention(op.param1, op.param2, "Gw",
settings["readerPesan"])
settings["getReader"][op.param1].append(op.param2)
if op.param1 in read["readPoint"]:
_name = client.getContact(op.param2).displayName
tz = pytz.timezone("Asia/Jakarta")
timeNow = datetime.now(tz=tz)
timeHours = datetime.strftime(timeNow," (%H:%M)")
read["readMember"][op.param1][op.param2] = str(_name) +
str(timeHours)
if op.type == 55:
print("[ 55 ] NOTIFIED READ MESSAGE")
try:
if op.param1 in wait['readPoint']:
if op.param2 in wait['ROM1'][op.param1]:
wait['setTime'][op.param1][op.param2] = op.createdTime
else:
wait['ROM1'][op.param1][op.param2] = op.param2
wait['setTime'][op.param1][op.param2] = op.createdTime
try:
if wait['lurkauto'] == True:
if len(wait['setTime'][op.param1]) % 5 == 0:
anulurk(op.param1,wait)
except:pass
elif op.param2 in wait['readPoints']:
wait['lurkt'][op.param1][op.param2][op.param3] = op.createdTime
wait['lurkp'][op.param1][op.param2][op.param3] = op.param2
else:pass
except:
pass
if op.type == 26:
print ("[ 26 ] RECEIVE MESSAGE")
msg = op.message
text = str(msg.text)
msg_id = msg.id
receiver = msg.to
sender = msg._from
to = msg.to
cmd = command(text)
isValid = True
setKey = settings["keyCommand"].title()
if settings["setKey"] == False: setKey = ''
if isValid != False:
if msg.toType == 0 and sender != clientMID: to = sender
else: to = receiver
if msg.contentType == 0 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
if msg.location != None:
unsendmsg = time.time()
msg_dict[msg.id] =
{"location":msg.location,"from":msg._from,"waktu":unsendmsg}
else:
unsendmsg = time.time()
msg_dict[msg.id] =
{"text":msg.text,"from":msg._from,"waktu":unsendmsg}
except Exception as e:
print (e)
if msg.contentType == 1 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
unsendmsg1 = time.time()
path = client.downloadObjectMsg(msg_id)
msg_dict[msg.id] =
{"from":msg._from,"image":path,"waktu":unsendmsg1}
except Exception as e:
print (e)
if msg.contentType == 2 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
unsendmsg2 = time.time()
path = client.downloadObjectMsg(msg_id)
msg_dict[msg.id] =
{"from":msg._from,"video":path,"waktu":unsendmsg2}
except Exception as e:
print (e)
if msg.contentType == 3 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
unsendmsg3 = time.time()
path = client.downloadObjectMsg(msg_id)
msg_dict[msg.id] =
{"from":msg._from,"audio":path,"waktu":unsendmsg3}
except Exception as e:
print (e)
if msg.contentType == 7 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
unsendmsg7 = time.time()
sticker = msg.contentMetadata["STKID"]
link =
"http://dl.stickershop.line.naver.jp/stickershop/v1/sticker/
{}/android/sticker.png".format(sticker)
msg_dict[msg.id] =
{"from":msg._from,"sticker":link,"waktu":unsendmsg7}
except Exception as e:
print (e)
if msg.contentType == 13 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
unsendmsg13 = time.time()
mid = msg.contentMetadata["mid"]
msg_dict[msg.id] =
{"from":msg._from,"mid":mid,"waktu":unsendmsg13}
except Exception as e:
print (e)
if msg.contentType == 14 and to not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
try:
unsendmsg14 = time.time()
path = client.downloadObjectMsg(msg_id)
msg_dict[msg.id] =
{"from":msg._from,"file":path,"waktu":unsendmsg14}
except Exception as e:
print (e)
if op.type == 65:
if op.param1 not in chatbot["botMute"]:
if settings["unsendMessage"] == True:
at = op.param1
msg_id = op.param2
if msg_id in msg_dict:
ah = time.time()
ikkeh = client.getContact(msg_dict[msg_id]["from"])
if "text" in msg_dict[msg_id]:
waktumsg = ah - msg_dict[msg_id]["waktu"]
waktumsg = format_timespan(waktumsg)
rat_ = "\nSend At :\n{} ago".format(waktumsg)
rat_ += "\nText :\n{}".format(msg_dict[msg_id]["text"])
sendMentionFooter(at, ikkeh.mid, "# Resend
Message\n\nMaker :\n", str(rat_))
del msg_dict[msg_id]
else:
if "image" in msg_dict[msg_id]:
waktumsg = ah - msg_dict[msg_id]["waktu"]
waktumsg = format_timespan(waktumsg)
rat_ = "\nSend At :\n{} ago".format(waktumsg)
rat_ += "\nImage :\nBelow"
sendMentionFooter(at, ikkeh.mid, "# Resend
Message\n\nMaker :\n~", str(rat_))
client.sendImage(at, msg_dict[msg_id]["image"])
del msg_dict[msg_id]
else:
if "video" in msg_dict[msg_id]:
waktumsg = ah - msg_dict[msg_id]["waktu"]
waktumsg = format_timespan(waktumsg)
rat_ = "\nSend At :\n{} ago".format(waktumsg)
rat_ += "\nVideo :\nBelow"
sendMentionFooter(at, ikkeh.mid, "# Resend
Message\n\nMaker :\n", str(rat_))
client.sendVideo(at, msg_dict[msg_id]["video"])
del msg_dict[msg_id]
else:
if "audio" in msg_dict[msg_id]:
waktumsg = ah - msg_dict[msg_id]["waktu"]
waktumsg = format_timespan(waktumsg)
rat_ = "\nSend At :\n{}
ago".format(waktumsg)
rat_ += "\nAudio :\nBelow"
sendMentionFooter(at, ikkeh.mid, "# Resend
Message\n\nMaker :\n", str(rat_))
client.sendAudio(at, msg_dict[msg_id]
["audio"])
del msg_dict[msg_id]
else:
if "sticker" in msg_dict[msg_id]:
waktumsg = ah - msg_dict[msg_id]
["waktu"]
waktumsg = format_timespan(waktumsg)
rat_ = "\nSend At :\n{}
ago".format(waktumsg)
rat_ += "\nSticker :\nBelow"
sendMentionFooter(at, ikkeh.mid, "#
Resend Message\n\nMaker :\n", str(rat_))
client.sendImageWithURL(at,
msg_dict[msg_id]["sticker"])
del msg_dict[msg_id]
else:
if "mid" in msg_dict[msg_id]:
waktumsg = ah - msg_dict[msg_id]
["waktu"]
waktumsg =
format_timespan(waktumsg)
rat_ = "\nSend At :\n{}
ago".format(waktumsg)
rat_ += "\nContact :\nBelow"
sendMentionFooter(at, ikkeh.mid, "#
Resend Message\n\nMaker :\n", str(rat_))
client.sendContact(at,
msg_dict[msg_id]["mid"])
del msg_dict[msg_id]
else:
if "location" in msg_dict[msg_id]:
waktumsg = ah -
msg_dict[msg_id]["waktu"]
waktumsg =
format_timespan(waktumsg)
rat_ = "\nSend At :\n{}
ago".format(waktumsg)
rat_ += "\nLocation :\nBelow"
sendMentionFooter(at,
ikkeh.mid, "# Resend Message\n\nMaker :\n", str(rat_))
client.sendLocation(at,
msg_dict[msg_id]["location"])
del msg_dict[msg_id]
else:
if "file" in msg_dict[msg_id]:
waktumsg = ah -
msg_dict[msg_id]["waktu"]
waktumsg =
format_timespan(waktumsg)
rat_ = "\nSend At :\n{}
ago".format(waktumsg)
rat_ += "\nFile :\nBelow"
sendMentionFooter(at,
ikkeh.mid, "# Resend Message\n\nMaker :\n", str(rat_))
client.sendFile(at,
msg_dict[msg_id]["file"])
del msg_dict[msg_id]
else:
print ("[ ERROR ] Terjadi Error Karena Tidak Ada Data Chat
Tersebut~")
backupData()
except Exception as error:
logError(error)
traceback.print_tb(error.__traceback__)
def run():
while True:
try:
delExpire()
ops = clientPoll.singleTrace(count=50)
if ops != None:
for op in ops:
loop.run_until_complete(clientBot(op))
#clientBot(op)
clientPoll.setRevision(op.revision)
except Exception as e:
logError(e)
if __name__ == "__main__":
run()