コード例 #1
0
  public static void onCommand(
      MJRBot bot,
      String channel,
      String sender,
      String login,
      String hostname,
      String message,
      String[] args) {
    if (Config.getSetting("Points").equalsIgnoreCase("true")) {
      if (args.length == 3) {
        String Points = args[1];
        String User = args[2];

        if (PointsSystem.isOnList(User)) {
          PointsSystem.AddPoints(User.toLowerCase(), Integer.parseInt(Points));
          bot.MessageToChat("Added " + Points + " points" + " to " + User);
        } else {
          bot.MessageToChat("Cant add " + Points + " points" + " to " + User);
        }
      } else {
        bot.MessageToChat("Invalid arguments! You need to enter !addpoints POINTS USER");
      }
    }
  }