mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
commit
2ddfe44a25
@ -23,6 +23,9 @@ from .Users import users as botusers
|
|||||||
from .Events import events as botevents
|
from .Events import events as botevents
|
||||||
|
|
||||||
|
|
||||||
|
# TODO check identify for OPs and bot admins
|
||||||
|
|
||||||
|
|
||||||
def prerun(t_command_type='module', t_command_subtype=None):
|
def prerun(t_command_type='module', t_command_subtype=None):
|
||||||
|
|
||||||
def actual_decorator(function):
|
def actual_decorator(function):
|
||||||
|
|||||||
@ -373,26 +373,28 @@ class BotUsers():
|
|||||||
nick_id = self.whois_ident(nick)
|
nick_id = self.whois_ident(nick)
|
||||||
|
|
||||||
# No registered check
|
# No registered check
|
||||||
if str(nick).lower() not in [x.lower() for x in list(self.dict["register_check"].keys())]:
|
if int(nick_id) not in list(self.dict["register_check"].keys()):
|
||||||
check_whois = True
|
check_whois = True
|
||||||
elif nick_id in self.dict["identified"]:
|
elif int(nick_id) in self.dict["identified"]:
|
||||||
timestamp = self.dict["register_check"][str(nick).lower()]
|
timestamp = self.dict["register_check"][int(nick_id)]
|
||||||
if time.time() - timestamp >= 1800:
|
if time.time() - timestamp >= 1800:
|
||||||
check_whois = True
|
check_whois = True
|
||||||
else:
|
else:
|
||||||
timestamp = self.dict["register_check"][str(nick).lower()]
|
timestamp = self.dict["register_check"][int(nick_id)]
|
||||||
if time.time() - timestamp >= 240:
|
if time.time() - timestamp >= 240:
|
||||||
check_whois = True
|
check_whois = True
|
||||||
if check_whois:
|
if check_whois:
|
||||||
bot.write(['WHOIS', str(nick)])
|
bot.write(['WHOIS', str(nick)])
|
||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
self.dict["register_check"][str(nick).lower()] = time.time()
|
self.dict["register_check"][int(nick_id)] = time.time()
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
|
||||||
def whois_identify_forget(self, nick_id):
|
def whois_identify_forget(self, nick_id):
|
||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
if int(nick_id) in self.dict["identified"]:
|
if int(nick_id) in self.dict["identified"]:
|
||||||
self.dict["identified"].remove(int(nick_id))
|
self.dict["identified"].remove(int(nick_id))
|
||||||
|
if int(nick_id) in list(self.dict["register_check"].keys()):
|
||||||
|
del self.dict["register_check"][int(nick_id)]
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
|
||||||
def account(self, bot, trigger):
|
def account(self, bot, trigger):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user