示例#1
0
 /**
  * Finds the {@link IUser} associated with the string. Checks in various formats.
  *
  * @param s String to be processed, either as the full name, the user ID, or the
  *     {@literal @mention} for the user.
  * @return The specified user in the bot's {@link IGuild}. If no user was found, returns null.
  */
 public static IUser getUser(String s) {
   final List<IGuild> current = Bot.getClient().getGuilds();
   for (IGuild g : current) {
     for (IUser u : g.getUsers()) {
       if (u.getName().equals(s) || u.getID().equals(s) || ("<@" + u.getID() + ">").equals(s)) {
         return u;
       }
     }
   }
   return null;
 }