-
Notifications
You must be signed in to change notification settings - Fork 3
/
irc.py
406 lines (381 loc) · 26.1 KB
/
irc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# -*- coding: utf-8 -*-
import socket
import datetime
import threading
import re
import time
import pytz
import psutil
import hashlib
import subprocess
import os
import datetime
from multiprocessing import Process, Queue, Pool
from shlex import quote
import settings
import abcalc
class IRC(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.channel_bot = settings.irc_channel_bot
self.nick = settings.irc_nick
self.server_name = settings.irc_server_name
self.server_port = settings.irc_server_port
self.server = None
self.scrapesite = None
self.messages_received = []
self.messages_sent = []
self.commands_received = []
self.commands_sent = []
# self.running_instagram = []
# self.running_instagram = 0
# self.processpool = Pool(processes=1)
def run(self):
self.connect()
def connect(self):
if self.server:
self.server.close()
settings.logger.log('Connecting to IRC server ' + self.server_name)
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server.connect((self.server_name, self.server_port))
self.send('USER', '{nick} {nick} {nick} :I am a bot; '
'https://github.com/Ghostofapacket/socialbot/.'
.format(nick=self.nick))
self.send('NICK', '{nick}'.format(nick=self.nick))
self.send('JOIN', '{channel_bot}'.format(
channel_bot=self.channel_bot))
# self.send('PRIVMSG', 'Version {version}.'
# .format(version=settings.version), self.channel_bot)
self.listener()
self.start_pinger()
settings.logger.log('Connected to ' + self.server_name + ' as ' + self.nick)
def start_pinger(self):
self.pinger = threading.Thread(target=self.pinger)
self.pinger.daemon = True
self.pinger.start()
def pinger(self):
while True:
time.sleep(600)
self.send('PING', ':')
def send(self, command, string, channel=''):
if channel != '':
channel += ' :'
message = '{command} {channel}{string}'.format(**locals())
try:
settings.logger.log('IRC - {message}'.format(**locals()))
self.messages_sent.append(message)
self.server.send('{message}\n'.format(**locals()).encode('utf-8'))
except Exception as exception:
settings.logger.log('{exception}'.format(**locals()), 'WARNING')
# self.connect()
# self.server.send('{message}\n'.format(**locals()))
def listener(self):
while True:
message = self.server.recv(4096).decode('utf-8')
self.messages_received.append(message)
for line in message.splitlines():
settings.logger.log('IRC - {line}'.format(**locals()))
if message.startswith('PING :'):
settings.logger.log('Received message ' + message)
message_new = re.search(r'^[^:]+:(.*)$', message).group(1)
self.send('PONG', ':{message_new}'.format(**locals()))
elif re.search(r'^:.+PRIVMSG[^:]+:socialbot', message):
if re.search(r'^:.+PRIVMSG[^:]+:socialbot .*', message):
command = re.search(r'^:.+PRIVMSG[^:]+:socialbot (.*)', message) \
.group(1).strip().split(' ')
command = [s.strip() for s in command if len(s.strip()) != 0]
user = re.search(r'^:([^!]+)!', message).group(1)
channel = re.search(r'^:[^#]+(#[^ :]+) ?:', message).group(1)
self.commands_received.append({'command': command,
'user': user,
'channel': channel})
self.command(command, user, channel)
settings.logger.log('COMMAND - Received in channel {channel} - {command[0]}'.format(**locals()))
elif re.search(r'^:.+PRIVMSG[^:]+:socialbot\: .*', message):
command = re.search(r'^:.+PRIVMSG[^:]+:socialbot\: (.*)', message) \
.group(1).strip().split(' ')
command = [s.strip() for s in command if len(s.strip()) != 0]
user = re.search(r'^:([^!]+)!', message).group(1)
channel = re.search(r'^:[^#]+(#[^ :]+) ?:', message).group(1)
self.commands_received.append({'command': command,
'user': user,
'channel': channel})
self.command(command, user, channel)
settings.logger.log('COMMAND - Received in channel {channel} - {command[0]}'.format(**locals()))
def check_admin(self, user):
# change to db
if str(user) == "Igloo":
return True
else:
return False
def getjobid(self, user):
sha_1 = hashlib.sha1()
time = str(datetime.datetime.now()) + '-' + user
sha_1.update(time.encode('utf-8'))
jobid = sha_1.hexdigest()
return jobid
def run_snscrape(self, channel, user, module, target, **kwargs):
jobid = self.getjobid(user + '-' + module + '-' + target)
settings.logger.log('SNSCRAPE - Job ID ' + jobid)
self.send('PRIVMSG', '{user}: {jobid} has been queued.' .format(user=user, jobid=jobid), channel)
settings.logger.log('SNSCRAPE - Trying to run snscrape with the following arguments - {module} - {target}' \
.format(**locals()))
sanityregex = re.compile('([\"\'\@\#])')
chromeboturls = None
if str(module).startswith("twitter"):
if str(module).startswith("twitter-user"):
settings.logger.log('SNSCRAPE - Checking username capitalisation for user ' + sanityregex.sub(r'',target))
try:
newtarget = subprocess.check_output("snscrape --max-results 1 twitter-user " + quote(sanityregex.sub(r'',target)) + " | grep -Po '^https?://twitter\.com/\K[^/]+'", shell=True).decode("utf-8").strip()
except subprocess.CalledProcessError as error:
newtarget = None
if newtarget is None:
settings.logger.log("SNSCRAPE - Twitter user " + quote(sanityregex.sub(r'',target)) + " not found")
self.send('PRIVMSG', '{user}: Sorry, No results found for {jobid} - User does not exist' .format(user=user, jobid=jobid), channel)
else:
settings.logger.log("SNSCRAPE - Running with updated settings - snscrape --format '{url} {tcooutlinksss} {outlinksss}' " + quote(module) + " " + newtarget + " >jobs/twitter-@" + jobid)
subprocess.run("snscrape --format '{url} {tcooutlinksss} {outlinksss}' " + quote(module) + " " + newtarget + " >jobs/twitter-@" + jobid, shell=True)
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + "-" + sanityregex.sub(r'',target))
#Insert the profile as per JAA's request :-)
profileline = "https://twitter.com/" + newtarget
lines = [profileline + "\n"]
with open("jobs/twitter-@" + jobid, "r") as outfile:
for line in outfile.read().split():
lines.append(line + "\n")
with open("jobs/twitter-@" + jobid, "w") as outfile:
outfile.writelines(lines)
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/twitter-@" + jobid + " https://transfer.notkiska.pw/twitter-@" + newtarget, shell=True).decode("utf-8")
chromeboturls = [profileline]
elif str(module).startswith("twitter-hash"):
subprocess.run("snscrape --format '{url} {tcooutlinksss} {outlinksss}' " + quote(module) + " " + quote(sanityregex.sub(r'',target)) + " >jobs/twitter-#" + jobid, shell=True)
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + '-' + sanityregex.sub(r'',target))
settings.logger.log("CURL - Uploading with curl -s --upload-file jobs/twitter-#" + jobid + " https://transfer.notkiska.pw/twitter-#" + sanityregex.sub(r'',target))
lines = []
lines.append("https://twitter.com/hashtag/" + target + "\n")
lines.append("https://twitter.com/hashtag/" + target + "?src=hash\n")
lines.append("https://twitter.com/hashtag/" + target + "?f=tweets&vertical=default\n")
lines.append("https://twitter.com/hashtag/" + target + "?f=tweets&vertical=default&src=hash\n")
with open("jobs/twitter-#" + jobid, "r") as outfile:
for line in outfile.read().split():
lines.append(line + "\n")
with open("jobs/twitter-#" + jobid, "w") as outfile:
outfile.writelines(lines)
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/twitter-#" + jobid + " https://transfer.notkiska.pw/twitter-%23" + quote(sanityregex.sub(r'',target)), shell=True).decode("utf-8")
newtarget = sanityregex.sub(r'',target)
chromeboturls = [x.strip() for x in lines[:4]]
elif str(module).startswith("twitter-search"):
maxpages = kwargs.get('maxpages', None)
if not maxpages is None:
subprocess.run("snscrape twitter-search --max-position " + maxpages + " " + quote(sanityregex.sub(r'',target)) + " >jobs/twitter-search-" + jobid, shell=True)
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + " " + sanityregex.sub(r'',target) + " maxpages set")
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/twitter-search-" + jobid + " https://transfer.notkiska.pw/twitter-search-" + quote(sanityregex.sub(r'',target)), shell=True).decode("utf-8")
newtarget = sanityregex.sub(r'',target)
if maxpages is None:
subprocess.run("snscrape twitter-search " + quote(sanityregex.sub(r'',target)) + " >jobs/twitter-search-" + jobid, shell=True)
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + "-" + sanityregex.sub(r'',target))
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/twitter-search-" + jobid + " https://transfer.notkiska.pw/twitter-search-" + quote(sanityregex.sub(r'',target)), shell=True).decode("utf-8")
newtarget = sanityregex.sub(r'',target)
else:
settings.logger.log('SNSCRAPE - Command not found')
bot.send('PRIVMSG', 'Sorry {user} command not found'.format(user=user), channel)
if not newtarget is None:
if uploadedurl.startswith("400"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
elif uploadedurl.startswith("Could not upload empty file"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
else:
uploadedurl = uploadedurl.replace('%40','@')
self.send('PRIVMSG', '!ao < {uploadedurl} --explain "For {user} - socialscrape job {jobid}"' \
.format(user=user, uploadedurl=uploadedurl, jobid=jobid), channel)
if chromeboturls:
for url in chromeboturls:
self.send('PRIVMSG', 'chromebot: a {url}'.format(url=url), channel)
if str(module).startswith("facebook"):
if str(module).startswith("facebook-user"):
settings.logger.log('SNSCRAPE - Checking username capitalisation for user ' + sanityregex.sub(r'',target))
try:
print("curl -s -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' -H 'Accept-Language: en-US,en;q=0.5' \"https://www.facebook.com/" + sanityregex.sub(r'',target) + "/\" | grep -Po '<div\s[^>]*(?<=\s)data-key\s*=\s*\"tab_home\".*?</div>' | grep -Po '<a\s[^>]*(?<=\s)href=\"/\K[^/]+'")
newtarget = subprocess.check_output("curl -s -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' -H 'Accept-Language: en-US,en;q=0.5' \"https://www.facebook.com/" + sanityregex.sub(r'',target) + "/\" | grep -Po '<div\s[^>]*(?<=\s)data-key\s*=\s*\"tab_home\".*?</div>' | grep -Po '<a\s[^>]*(?<=\s)href=\"/\K[^/]+'", shell=True).decode("utf-8").strip()
print(newtarget)
except subprocess.CalledProcessError as error:
newtarget = None
if newtarget is None:
settings.logger.log("SNSCRAPE - Facebook user " + quote(sanityregex.sub(r'',target)) + " not found")
self.send('PRIVMSG', '{user}: Sorry, No results found for {jobid} - User does not exist / profile is set to private' .format(user=user, jobid=jobid), channel)
else:
settings.logger.log("SNSCRAPE - Running with updated settings - snscrape " + quote(module) + " " + newtarget + " >jobs/facebook-@" + jobid)
subprocess.run("snscrape --format '{cleanUrl} {outlinksss}' " + quote(module) + " " + newtarget + " >jobs/facebook-@" + jobid, shell=True)
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + "-" + sanityregex.sub(r'',target))
profileline = "https://www.facebook.com/" + newtarget + "/"
lines = [profileline + "\n"]
with open("jobs/facebook-@" + jobid, "r") as outfile:
for line in outfile.read().split():
lines.append(line + "\n")
with open("jobs/facebook-@" + jobid, "w") as outfile:
outfile.writelines(lines)
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/facebook-@" + jobid + " https://transfer.notkiska.pw/facebook-@" + newtarget, shell=True).decode("utf-8")
if not newtarget is None:
if uploadedurl.startswith("400"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
elif uploadedurl.startswith("Could not upload empty file"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
else:
uploadedurl = uploadedurl.replace('%40','@')
self.send('PRIVMSG', '!ao < {uploadedurl} --useragent firefox --explain "For {user} - socialscrape job {jobid}" ' \
.format(user=user, uploadedurl=uploadedurl, jobid=jobid), channel)
self.send('PRIVMSG', 'chromebot: a https://www.facebook.com/{target}/'.format(target=newtarget), channel)
else:
settings.logger.log('SNSCRAPE - Command not found')
bot.send('PRIVMSG', 'Sorry {user} command not found'.format(user=user), channel)
if str(module).startswith("instagram"):
while os.path.isfile('Instagram_run'):
settings.logger.log('SNSCRAPE - instagram scrape already in progress, sleeping for 5 seconds')
time.sleep(5)
open('Instagram_run', 'w').close()
if str(module).startswith("instagram-user"):
settings.logger.log("snscrape --format '{dirtyUrl}' " + module + " " + sanityregex.sub(r'',target) + " >jobs/instagram-@" + jobid)
subprocess.run("snscrape --format '{dirtyUrl}' " + quote(module) + " " + quote(sanityregex.sub(r'',target)) + " >jobs/instagram-@" + jobid, shell=True)
if not os.stat("jobs/instagram-@" + jobid).st_size == 0:
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + "-@" + sanityregex.sub(r'',target))
#Insert the profile as per JAA's request :-)
outfile = open("jobs/instagram-@" + jobid, "r")
profileline = "https://www.instagram.com/" + target + "/\n"
lines = outfile.readlines()
lines.insert(0,profileline)
outfile.close()
outfile=open("jobs/instagram-@" + jobid, "w")
outfile.writelines(lines)
outfile.close()
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/instagram-@" + jobid + " https://transfer.notkiska.pw/instagram-@" + quote(sanityregex.sub(r'',target)), shell=True).decode("utf-8")
archivebotid = abcalc.jobid(uploadedurl)
jobfile = "jobs/instagram-@" + jobid
else:
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid} - User does not exist'.format(user=user,jobid=jobid),channel)
jobfile = "jobs/instagram-@" + jobid
os.remove('Instagram_run')
elif str(module).startswith("instagram-hashtag"):
subprocess.run("snscrape --format '{dirtyUrl}' " + quote(module) + " " + quote(sanityregex.sub(r'',target)) + " >jobs/instagram-#" + jobid, shell=True)
if not os.stat("jobs/instagram-#" + jobid).st_size == 0:
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + "-" + sanityregex.sub(r'',target))
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/instagram-#" + jobid + " https://transfer.notkiska.pw/instagram-%23" + quote(sanityregex.sub(r'',target)), shell=True).decode("utf-8")
archivebotid = abcalc.jobid(uploadedurl)
uploadedurl = uploadedurl.replace('%40','@')
jobfile = "jobs/instagram-#" + jobid
else:
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid} - Hashtag does not exist'.format(user=user,jobid=jobid),channel)
jobfile = "jobs/instagram-#" + jobid
os.remove('Instagram_run')
else:
settings.logger.log('SNSCRAPE - Command not found')
bot.send('PRIVMSG', 'Sorry {user} command not found'.format(user=user), channel)
if not os.stat(jobfile).st_size == 0:
#Should be standard for all jobs
if uploadedurl.startswith("400"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
elif uploadedurl.startswith("Could not upload empty file"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
else:
uploadedurl = uploadedurl.replace('%40','@')
self.send('PRIVMSG', '!a < {uploadedurl} --explain "For {user} - socialscrape job {jobid}" --igset instagram' \
.format(user=user, uploadedurl=uploadedurl, jobid=jobid), channel)
os.remove('Instagram_run')
if str(module).startswith("vkontakte"):
if str(module).startswith("vkontakte-user"):
newtarget = target
settings.logger.log("SNSCRAPE - Running with updated settings - snscrape " + quote(module) + " " + newtarget.strip() + " >jobs/vkontakte-" + jobid)
subprocess.run("snscrape " + quote(module) + " " + newtarget.strip() + " >jobs/vkontakte-" + jobid, shell=True)
settings.logger.log('SNSCRAPE - Finished ' + jobid + ' - Uploading to https://transfer.notkiska.pw/' + module + "-" + sanityregex.sub(r'',target))
profileline = "https://vk.com/" + newtarget.strip() + "/"
lines = [profileline + "\n"]
with open("jobs/vkontakte-" + jobid, "r") as outfile:
for line in outfile.read().split():
lines.append(line + "\n")
with open("jobs/vkontakte-" + jobid, "w") as outfile:
outfile.writelines(lines)
uploadedurl = subprocess.check_output("curl -s --upload-file jobs/vkontakte-" + jobid + " https://transfer.notkiska.pw/vkontakte-" + newtarget, shell=True).decode("utf-8")
if not newtarget is None:
if uploadedurl.startswith("400"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
elif uploadedurl.startswith("Could not upload empty file"):
self.send('PRIVMSG', '{user}: Sorry, No results returned for {jobid}'.format(user=user,jobid=jobid),channel)
else:
self.send('PRIVMSG', '!ao < {uploadedurl} --explain "For {user} - socialscrape job {jobid}" ' \
.format(user=user, uploadedurl=uploadedurl, jobid=jobid), channel)
self.send('PRIVMSG', 'chromebot: a https://vk.com/{target}/'.format(target=newtarget), channel)
def command(self, command, user, channel):
if command[0] == 'help':
self.send('PRIVMSG', '{user}: For IRC commands can be found at - '
'https://github.com/ghostofapacket/socialbot/blob/commands.md'
.format(**locals()), channel)
elif command[0] == 'stop' and self.check_admin(user) == True:
settings.logger.log('EMERGENCY: {user} has requested I stop'.format(**locals()))
settings.run_services.stop()
self.send('PRIVMSG', '{user}: Stopped.'
.format(**locals()), channel)
settings.running = False
elif command[0] == 'update' and self.check_admin(user) == True:
open('STOP', 'w').close()
settings.logger.log('WARNING: {user} has requested I update'.format(**locals()))
self.server.close()
settings.run_services.stop()
elif command[0] == 'version':
self.send('PRIVMSG', '{user}: Version is {version}.'
.format(user=user, version=settings.version), channel)
elif command[0] == 'snsupdate' and self.check_admin(user) == True:
# Do the git pull and reload the module here
settings.logger.log('WARNING: {user} has requested I update snscrape'.format(**locals()))
self.send('PRIVMSG','Starting snscrape update')
subprocess.run(["updatesnscrape.sh"])
self.send('PRIVMSG','snscrape update complete')
elif command[0] == 'snscrape':
# Get the site to scrape
try:
function = command[1]
queue = Queue()
if function.startswith('twitter-'):
module = command[1]
target = command[2]
try:
args = command[3]
print(args)
if str(args) != "maxpages":
self.send('PRIVMSG', user + ': Sorry, Command not recognised. Did you mean "maxpages" ?'.format(user=user), channel)
else:
keywords = {'maxpages': command[4]}
runsnscrape = Process(target=self.run_snscrape, args=(channel, user, module, target), kwargs=keywords)
runsnscrape.start()
except IndexError:
runsnscrape = Process(target=self.run_snscrape, args=(channel, user, module, target))
runsnscrape.start()
if function.startswith('instagram-'):
# sendnudez
module = command[1]
target = command[2]
try:
args = command[3]
runsnscrape = Process(target=self.run_snscrape, args=(channel, user, module, target))
runsnscrape.start()
# runsnscrape = self.processpool.apply_async(self.run_snscrape, args=(channel, user, module, target))
# self.running_instagram.append(runsnscrape)
except IndexError:
runsnscrape = Process(target=self.run_snscrape, args=(channel, user, module, target))
runsnscrape.start()
# runsnscrape = self.processpool.apply_async(self.run_snscrape, args=(channel, user, module, target))
# self.running_instagram.append(runsnscrape)
if function == 'gab':
# whatevenisgab?
settings.logger.log('gab')
if function == 'vkontakte-user':
module = command[1]
target = command[2]
runsnscrape = Process(target=self.run_snscrape, args=(channel, user, module, target))
runsnscrape.start()
if function.startswith('facebook'):
# faceballs
module = command[1]
target = command[2]
runsnscrape = Process(target=self.run_snscrape, args=(channel, user, module, target))
runsnscrape.start()
except IndexError:
self.send('PRIVMSG', user + ': Missing site; try ' + self.nick + ' snscrape instagram-user,instagram-hashtag'\
+ ',twitter-user,twitter-hashtag,twitter-search'.format(user=user), channel)