def cmd_standing(match, entry, userinfo): if len(match.groups()) == 0: targetname = userinfo["username"] else: targetname = match.group(1) users.message(userinfo, "User " + targetname + " has standing " + str(users.getuserstanding_byname(targetname)) + "\r\n") return True # No more processing from command list
def cmd_optout_arg(match, entry, userinfo): feature = match.group(1) if feature != externals.feature_id: return if "optin" in userinfo: del userinfo["optin"] saveconfig() users.message(userinfo, userinfo["username"] + ", you have now opted out of being part of the experiment.")
def twitchonly_optin_arg(match, entry, userinfo): feature = match.group(1) if feature != externals.feature_id: return userinfo["optin"] = True saveconfig() users.message(userinfo, userinfo["username"] + ", you have now opted in to being part of the experiment.") users.message(userinfo, "Your chat will now appear on the " + externals.feature_description + ".") users.message(userinfo, "You now have access to a bunch of commands. Try !help") users.message(userinfo, "You can opt out of this by typing !optout " + externals.feature_id)
def cmd_help(match, entry, userinfo): if len(match.groups()) == 0: users.message(userinfo, "Available commands: " + " ".join(help_map)) else: cmd = match.group(1) if cmd in help_map: users.message(userinfo, help_map[cmd]["help"]) else: users.message(userinfo, "Unknown command \"" + cmd + "\"")
def twitchonly_optin_noarg(match, entry, userinfo): users.message(userinfo, "Try \"!optin " + externals.feature_id + "\" to join the " + externals.feature_description)
def runcmd(userinfo, cmd): print("Running command \"" + cmd + "\" by " + userinfo["username"]) print("User info: " + str(userinfo)) if regexhandling.handle_rlist(cmd, cmd_rlist, userinfo) == 0: users.message(userinfo, "Unknown command")
def cmd_optout_noarg(match, entry, userinfo): users.message(userinfo, userinfo["username"] + ", you can opt out of " + externals.feature_description + " by typing !optout " + externals.feature_id)
def cmd_wrong_params(match, entry, userinfo): users.message(userinfo, "Incorrect usage of command") return True # No more processing from command list
def cmd_opinion(match, entry, userinfo): users.message(userinfo, "The gods " + gods.describe_opinion(users.getuservalue(userinfo, "opinion")) + " you") return True # No more processing from command list
def cmd_godmood_report(match, entry, userinfo): users.message(userinfo, "The gods are currently " + gods.describe_mood(gods.mood)) return True # No more processing from command list