コード例 #1
0
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
コード例 #2
0
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.")
コード例 #3
0
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)
コード例 #4
0
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 + "\"")
コード例 #5
0
def twitchonly_optin_noarg(match, entry, userinfo):
  users.message(userinfo, "Try \"!optin " + externals.feature_id + "\" to join the " + externals.feature_description)
コード例 #6
0
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")
コード例 #7
0
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)
コード例 #8
0
def cmd_wrong_params(match, entry, userinfo):
  users.message(userinfo, "Incorrect usage of command")
  return True # No more processing from command list
コード例 #9
0
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
コード例 #10
0
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