mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
adjsut query prerun
This commit is contained in:
parent
f654d38671
commit
2614ee5b50
@ -248,25 +248,25 @@ def trigger_runstatus_query(bot, trigger):
|
|||||||
# 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), "fully")
|
channel_disabled_list = botcommands.get_commands_disabled(str(trigger.sender), "fully")
|
||||||
if "nickname_query" in list(channel_disabled_list.keys()):
|
if trigger.sb["realcomref"] in list(channel_disabled_list.keys()):
|
||||||
reason = channel_disabled_list["nickname_query"]["reason"]
|
reason = channel_disabled_list[trigger.sb["realcomref"]]["reason"]
|
||||||
timestamp = channel_disabled_list["nickname_query"]["timestamp"]
|
timestamp = channel_disabled_list[trigger.sb["realcomref"]]["timestamp"]
|
||||||
bywhom = channel_disabled_list["nickname_query"]["disabledby"]
|
bywhom = channel_disabled_list[trigger.sb["realcomref"]]["disabledby"]
|
||||||
message = "The " + str(trigger.sb["comtext"]) + " command was disabled by " + bywhom + " for " + str(trigger.sender) + " at " + str(timestamp) + " for the following reason: " + str(reason)
|
message = "The " + str(trigger.sb["comtext"]) + " command was disabled by " + bywhom + " for " + str(trigger.sender) + " at " + str(timestamp) + " for the following reason: " + str(reason)
|
||||||
return trigger_cant_run(bot, trigger, message)
|
return trigger_cant_run(bot, trigger, message)
|
||||||
|
|
||||||
# don't run commands that are disabled for specific users
|
# don't run commands that are disabled for specific users
|
||||||
nick_disabled_list = botcommands.get_commands_disabled(str(trigger.nick), "fully")
|
nick_disabled_list = botcommands.get_commands_disabled(str(trigger.nick), "fully")
|
||||||
if "nickname_query" in list(nick_disabled_list.keys()):
|
if trigger.sb["realcomref"] in list(nick_disabled_list.keys()):
|
||||||
bywhom = nick_disabled_list["nickname_query"]["disabledby"]
|
bywhom = nick_disabled_list[trigger.sb["realcomref"]]["disabledby"]
|
||||||
if bywhom != trigger.nick:
|
if botusers.ID(bywhom) != botusers.ID(trigger.nick):
|
||||||
reason = nick_disabled_list["nickname_query"]["reason"]
|
reason = nick_disabled_list[trigger.sb["realcomref"]]["reason"]
|
||||||
timestamp = nick_disabled_list["nickname_query"]["timestamp"]
|
timestamp = nick_disabled_list[trigger.sb["realcomref"]]["timestamp"]
|
||||||
message = "The " + str(trigger.sb["comtext"]) + " command was disabled by " + bywhom + " for " + str(trigger.sender) + " at " + str(timestamp) + " for the following reason: " + str(reason)
|
message = "The " + str(trigger.sb["comtext"]) + " command was disabled by " + bywhom + " for " + str(trigger.sender) + " at " + str(timestamp) + " for the following reason: " + str(reason)
|
||||||
return trigger_cant_run(bot, trigger, message)
|
return trigger_cant_run(bot, trigger, message)
|
||||||
else:
|
else:
|
||||||
botcommands.unset_command_disabled(trigger.sb["realcomref"], trigger.nick, "fully")
|
botcommands.unset_command_disabled(trigger.sb["realcomref"], trigger.nick, "fully")
|
||||||
botmessagelog.messagelog(trigger.sb["log_id"], trigger.sb["comtext"] + " is now enabled for " + str(trigger.nick))
|
botmessagelog.messagelog_error(trigger.sb["log_id"], trigger.sb["comtext"] + " is now enabled for " + str(trigger.nick))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user