Adds in the Discord Verification system and fixes the bot~

This commit is contained in:
AnonymousHybi
2018-05-20 01:32:12 +01:00
parent f28646dffe
commit e7822eb506
9 changed files with 113 additions and 36 deletions
+14 -15
View File
@@ -1,31 +1,30 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# Four arguments, password host channel and message.
# EG: "ircbot_message.py hunter2 example.com #adminchannel ADMINHELP, people are killing me!"
import sys,cPickle,socket,HTMLParser
import sys
import socket
def pack():
ht = HTMLParser.HTMLParser()
passwd = sys.argv[1]
ip = sys.argv[3]
try:
data = []
for in_data in sys.argv[4:]: #The rest of the arguments is data
data += {ht.unescape(in_data)}
data = sys.argv[4:]
print(data)
except:
data = "NO DATA SPECIFIED"
dictionary = {"ip":ip,"data":[passwd] + data}
pickled = cPickle.dumps(dictionary)
nudge(pickled)
data = str(data)
data = bytes(data, "ascii")
print(data)
nudge(data)
def nudge(data):
HOST = sys.argv[2]
PORT = 45678
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST,PORT))
s.connect((HOST, PORT))
s.send(data)
s.close()
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
pack()
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
pack()