mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
try it this way
This commit is contained in:
parent
1f968d1c7b
commit
5e53e650f3
@ -285,12 +285,22 @@ def trigger_runstatus_query(bot, trigger, botcom):
|
|||||||
botmessagelog.messagelog_error(botcom.dict["log_id"], "The admin switch (-a) is for use by authorized nicks ONLY.")
|
botmessagelog.messagelog_error(botcom.dict["log_id"], "The admin switch (-a) is for use by authorized nicks ONLY.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Stop here if not registered
|
# Stop here if not registered or not identified
|
||||||
if bot.config.SpiceBot_regnick.regnick:
|
if bot.config.SpiceBot_regnick.regnick:
|
||||||
|
|
||||||
|
# not registered
|
||||||
if str(trigger.nick).lower() not in [x.lower() for x in botusers.dict["registered"]]:
|
if str(trigger.nick).lower() not in [x.lower() for x in botusers.dict["registered"]]:
|
||||||
message = "The query command requires you to be registerd with IRC services. Registering may take a few minutes to process with the bot."
|
message = "The " + str(botcom.dict["comtext"]) + " command requires you to be registered with IRC services. Registering may take a few minutes to process with the bot."
|
||||||
return trigger_cant_run(bot, trigger, botcom, message)
|
return trigger_cant_run(bot, trigger, botcom, message)
|
||||||
|
|
||||||
|
# registered nick, but not identified
|
||||||
|
else:
|
||||||
|
message = "None"
|
||||||
|
# if str(trigger.nick).lower() not in [x.lower() for x in botusers.dict["identified"]]:
|
||||||
|
# message = "Your nickname appears to be registered with IRC services. However, you have not identified. Identifying may take a few minutes to process with the bot."
|
||||||
|
# return trigger_cant_run(bot, trigger, botcom, message)
|
||||||
|
# TODO
|
||||||
|
|
||||||
# don't run commands that are disabled in channels
|
# don't run commands that are disabled in channels
|
||||||
if not trigger.is_privmsg:
|
if not trigger.is_privmsg:
|
||||||
channel_disabled_list = botcommands.get_commands_disabled(str(trigger.sender))
|
channel_disabled_list = botcommands.get_commands_disabled(str(trigger.sender))
|
||||||
@ -342,12 +352,22 @@ def trigger_runstatus(bot, trigger, botcom):
|
|||||||
botmessagelog.messagelog_error(botcom.dict["log_id"], "The admin switch (-a) is for use by authorized nicks ONLY.")
|
botmessagelog.messagelog_error(botcom.dict["log_id"], "The admin switch (-a) is for use by authorized nicks ONLY.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Stop here if not registered
|
# Stop here if not registered or not identified
|
||||||
if bot.config.SpiceBot_regnick.regnick:
|
if bot.config.SpiceBot_regnick.regnick:
|
||||||
|
|
||||||
|
# not registered
|
||||||
if str(trigger.nick).lower() not in [x.lower() for x in botusers.dict["registered"]]:
|
if str(trigger.nick).lower() not in [x.lower() for x in botusers.dict["registered"]]:
|
||||||
message = "The " + str(botcom.dict["comtext"]) + " command requires you to be registerd with IRC services. Registering may take a few minutes to process with the bot."
|
message = "The " + str(botcom.dict["comtext"]) + " command requires you to be registered with IRC services. Registering may take a few minutes to process with the bot."
|
||||||
return trigger_cant_run(bot, trigger, botcom, message)
|
return trigger_cant_run(bot, trigger, botcom, message)
|
||||||
|
|
||||||
|
# registered nick, but not identified
|
||||||
|
else:
|
||||||
|
message = "None"
|
||||||
|
# if str(trigger.nick).lower() not in [x.lower() for x in botusers.dict["identified"]]:
|
||||||
|
# message = "Your nickname appears to be registered with IRC services. However, you have not identified. Identifying may take a few minutes to process with the bot."
|
||||||
|
# return trigger_cant_run(bot, trigger, botcom, message)
|
||||||
|
# TODO
|
||||||
|
|
||||||
# if botcom.dict["hyphen_arg"]:
|
# if botcom.dict["hyphen_arg"]:
|
||||||
# return False
|
# return False
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,8 @@ class BotUsers():
|
|||||||
"away": [],
|
"away": [],
|
||||||
"current": {},
|
"current": {},
|
||||||
"registered": botdb.get_bot_value('regged_users') or [],
|
"registered": botdb.get_bot_value('regged_users') or [],
|
||||||
"notregistered": {},
|
"register_check": {},
|
||||||
|
"identified": [],
|
||||||
}
|
}
|
||||||
"""during setup, all users from database are offline until marked online"""
|
"""during setup, all users from database are offline until marked online"""
|
||||||
for user_id in list(self.dict["all"].keys()):
|
for user_id in list(self.dict["all"].keys()):
|
||||||
@ -357,14 +358,14 @@ class BotUsers():
|
|||||||
if str(nick).lower() not in [x.lower() for x in self.dict["registered"]]:
|
if str(nick).lower() not in [x.lower() for x in self.dict["registered"]]:
|
||||||
self.dict["registered"].append(str(nick))
|
self.dict["registered"].append(str(nick))
|
||||||
else:
|
else:
|
||||||
self.dict["notregistered"][str(nick).lower()] = time.time()
|
self.dict["register_check"][str(nick).lower()] = time.time()
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
|
||||||
def whois_send(self, bot, nick):
|
def whois_send(self, bot, nick):
|
||||||
if not bot.config.SpiceBot_regnick.regnick:
|
if not bot.config.SpiceBot_regnick.regnick:
|
||||||
return
|
return
|
||||||
if str(nick).lower() in [x.lower() for x in list(self.dict["notregistered"].keys())]:
|
if str(nick).lower() in [x.lower() for x in list(self.dict["register_check"].keys())]:
|
||||||
timestamp = self.dict["notregistered"][str(nick).lower()]
|
timestamp = self.dict["register_check"][str(nick).lower()]
|
||||||
if time.time() - timestamp < 240:
|
if time.time() - timestamp < 240:
|
||||||
return
|
return
|
||||||
if str(nick).lower() not in [x.lower() for x in self.dict["registered"]]:
|
if str(nick).lower() not in [x.lower() for x in self.dict["registered"]]:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user