This commit is contained in:
parent
9dad9ea04d
commit
f70ede55ca
1 changed files with 16 additions and 13 deletions
|
@ -52,21 +52,24 @@ class IRCatModule:
|
||||||
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :Invalid verification.\r\n", "UTF-8"))
|
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :Invalid verification.\r\n", "UTF-8"))
|
||||||
elif len(args) > 0 and args[0].lower() == "register":
|
elif len(args) > 0 and args[0].lower() == "register":
|
||||||
if len(args) == 3:
|
if len(args) == 3:
|
||||||
if not nick in self.memory:
|
if not self.sql.nickserv_isexist(nick.lower()):
|
||||||
context = ssl.create_default_context()
|
if not nick in self.memory:
|
||||||
token = str(uuid.uuid4())
|
context = ssl.create_default_context()
|
||||||
message = f"\\\nSubject: {self.net_name} Account Verification\n\nHi,\nIt appears you have tried to register an account ({nick}) with this email on {self.net_name},\nIf you did not register an account, feel free to delete this email.\nIf you did, use this command:\n/nickserv verify {nick} {token}"
|
token = str(uuid.uuid4())
|
||||||
with smtplib.SMTP(self.smtp_server, self.smtp_port) as server:
|
message = f"Subject: {self.net_name} Account Verification\n\nHi,\nIt appears you have tried to register an account ({nick}) with this email on {self.net_name},\nIf you did not register an account, feel free to delete this email.\nIf you did, use this command:\n/nickserv verify {nick} {token}"
|
||||||
server.ehlo()
|
with smtplib.SMTP(self.smtp_server, self.smtp_port) as server:
|
||||||
if self.smtp_starttls:
|
|
||||||
server.starttls(context=context)
|
|
||||||
server.ehlo()
|
server.ehlo()
|
||||||
server.login(self.smtp_username, self.smtp_password)
|
if self.smtp_starttls:
|
||||||
server.sendmail(self.smtp_username, args[2], message)
|
server.starttls(context=context)
|
||||||
self.memory[nick.lower()] = [token, args[1], args[2]]
|
server.ehlo()
|
||||||
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :Email sent, please verify.\r\n", "UTF-8"))
|
server.login(self.smtp_username, self.smtp_password)
|
||||||
|
server.sendmail(self.smtp_username, args[2], message)
|
||||||
|
self.memory[nick.lower()] = [token, args[1], args[2]]
|
||||||
|
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :Email sent, please verify.\r\n", "UTF-8"))
|
||||||
|
else:
|
||||||
|
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :A verification is already pending.\r\n", "UTF-8"))
|
||||||
else:
|
else:
|
||||||
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :A verification is already pending.\r\n", "UTF-8"))
|
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :The user {nick} already exists.\r\n", "UTF-8"))
|
||||||
else:
|
else:
|
||||||
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :Needs 3 arguments, nickname, password, and email.\r\n", "UTF-8"))
|
connection.sendall(bytes(f":NickServ!Meow@PawServ NOTICE {nick} :Needs 3 arguments, nickname, password, and email.\r\n", "UTF-8"))
|
||||||
elif len(args) > 0 and args[0].lower() == "identify":
|
elif len(args) > 0 and args[0].lower() == "identify":
|
||||||
|
|
Loading…
Add table
Reference in a new issue