mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
test
This commit is contained in:
parent
8db4017ca2
commit
eda13e004b
@ -582,31 +582,36 @@ def trigger_hyphen_arg_handler(bot, trigger, botcom):
|
|||||||
botmessagelog.messagelog_error(botcom.dict["log_id"], "What would you like to " + directionword + " from the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list?")
|
botmessagelog.messagelog_error(botcom.dict["log_id"], "What would you like to " + directionword + " from the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list?")
|
||||||
return False, botcom
|
return False, botcom
|
||||||
|
|
||||||
|
if botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "shared":
|
||||||
|
customresponses = botdb.get_nick_value(str(bot.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), 'sayings') or []
|
||||||
|
elif botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "user":
|
||||||
|
customresponses = botdb.get_nick_value(str(trigger.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), 'sayings') or []
|
||||||
|
|
||||||
if botcom.dict["hyphen_arg"] in ['add']:
|
if botcom.dict["hyphen_arg"] in ['add']:
|
||||||
if fulltext in botcom.dict["dict"][botcom.dict["responsekey"]]["responses"]:
|
if fulltext in customresponses:
|
||||||
botmessagelog.messagelog_error(botcom.dict["log_id"], "The following was already in the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
botmessagelog.messagelog_error(botcom.dict["log_id"], "The following was already in the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
||||||
return False, botcom
|
return False, botcom
|
||||||
|
|
||||||
botcom.dict["dict"][botcom.dict["responsekey"]]["responses"].append(fulltext)
|
customresponses.append(fulltext)
|
||||||
|
|
||||||
if botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "shared":
|
if botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "shared":
|
||||||
botdb.set_nick_value(str(bot.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), botcom.dict["dict"][botcom.dict["responsekey"]]["responses"])
|
botdb.set_nick_value(str(bot.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), customresponses)
|
||||||
elif botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "user":
|
elif botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "user":
|
||||||
botdb.set_nick_value(str(trigger.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), botcom.dict["dict"][botcom.dict["responsekey"]]["responses"])
|
botdb.set_nick_value(str(trigger.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), customresponses)
|
||||||
|
|
||||||
botmessagelog.messagelog(botcom.dict["log_id"], "The following was added to the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
botmessagelog.messagelog(botcom.dict["log_id"], "The following was added to the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
||||||
return False, botcom
|
return False, botcom
|
||||||
|
|
||||||
elif botcom.dict["hyphen_arg"] in ['del', 'remove']:
|
elif botcom.dict["hyphen_arg"] in ['del', 'remove']:
|
||||||
if fulltext not in botcom.dict["dict"][botcom.dict["responsekey"]]["responses"]:
|
if fulltext not in customresponses:
|
||||||
botmessagelog.messagelog_error(botcom.dict["log_id"], "The following was already not in the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
botmessagelog.messagelog_error(botcom.dict["log_id"], "The following was already not in the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
||||||
return False, botcom
|
return False, botcom
|
||||||
botcom.dict["dict"][botcom.dict["responsekey"]]["responses"].remove(fulltext)
|
customresponses.remove(fulltext)
|
||||||
|
|
||||||
if botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "shared":
|
if botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "shared":
|
||||||
botdb.set_nick_value(str(bot.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), botcom.dict["dict"][botcom.dict["responsekey"]]["responses"])
|
botdb.set_nick_value(str(bot.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), customresponses)
|
||||||
elif botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "user":
|
elif botcom.dict["dict"][botcom.dict["responsekey"]]["updates_enabled"] == "user":
|
||||||
botdb.set_nick_value(str(trigger.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), botcom.dict["dict"][botcom.dict["responsekey"]]["responses"])
|
botdb.set_nick_value(str(trigger.nick), botcom.dict["dict"]["validcoms"][0] + "_" + str(botcom.dict["responsekey"]), customresponses)
|
||||||
|
|
||||||
botmessagelog.messagelog(botcom.dict["log_id"], "The following was removed from the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
botmessagelog.messagelog(botcom.dict["log_id"], "The following was removed from the " + str(botcom.dict["realcom"]) + " " + str(botcom.dict["responsekey"] or '') + " entry list: '" + str(fulltext) + "'")
|
||||||
return False, botcom
|
return False, botcom
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user