本文整理汇总了Java中sx.blah.discord.handle.obj.IUser.getID方法的典型用法代码示例。如果您正苦于以下问题:Java IUser.getID方法的具体用法?Java IUser.getID怎么用?Java IUser.getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sx.blah.discord.handle.obj.IUser
的用法示例。
在下文中一共展示了IUser.getID方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DiscordUser
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public DiscordUser(IUser user) {
this.id = user.getID();
this.name = user.getName();
}
示例2: PrivateChannelUser
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public PrivateChannelUser(IUser u) {
super.userID = u.getID();
}
示例3: User
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
User(IUser user) {
userID = user.getID();
groups.add("Default");
}
示例4: execute
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
@Override
public MessageBuilder execute(CommandData<Baristron> commandData) {
if (commandData.getArgs().size() < 2)
return CommandResponse.getWrongArgumentsMessage(commandData.getChannel(), this, commandData.getCmdUsed(),
commandData);
IUser u = Utils.findFirstUser(commandData.getBot().client, commandData.getArgs().get(0),
commandData.getChannel().getGuild());
if (u == null) {
return CommandResponse.withAutoDeleteMessage(Bot.getNewBuilder(commandData.getChannel())
.withContent("Couldn't find that commandData.getUser()!"), Bot.AUTO_DELETE_TIME);
}
String lookingFor = Utils.getContent(commandData.getFullContent(), 1);
File file = new File("savedata/markov/" + u.getID() + ".txt");
if (!file.exists())
return Bot.getNewBuilder(commandData.getChannel()).withContent(
"That commandData.getUser()'s markov file doesn't exist! " +
"(They may not have said anything yet.)");
String content = null;
try {
content = FileUtils.readFileToString(file, "UTF-8").toLowerCase(Locale.ROOT);
} catch (IOException e) {
e.printStackTrace();
}
if (content == null || content.isEmpty())
return Bot.getNewBuilder(commandData.getChannel())
.withContent("Nothing's in the commandData.getUser()'s markov " + "file.");
MetadataMessageBuilder builder = Bot.getNewBuilder(commandData.getChannel()).withContent(
"Occurrences of `" + lookingFor + "` in the words of " +
u.getDisplayName(commandData.getChannel().getGuild()) + ":\n");
long count = StringUtils.countMatches(content, lookingFor.toLowerCase(Locale.ROOT));
Map<String, String> map = VerticalAligner.reusableMap;
map.clear();
map.put("Occurrences:", "" + count);
map.put("Total characters:", "" + content.length());
map.put("% of text:",
String.format("%.3f", ((count * lookingFor.length() * 1f) / content.length()) * 100f) + "%");
builder.appendContent("```\n" + VerticalAligner.align(map, " -> ", true) + "\n```");
Bot.sendMessage(builder);
return null;
}
示例5: convertUser
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String convertUser(IUser user) {
return user.getName() + "#" + user.getDiscriminator() + " (" + user.getID() + ")";
}
示例6: getSaveFile
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static File getSaveFile(IUser user, byte slot){
return new File(config.SAVEDIR+'/'+user.getID()+"/"+slot);
}
示例7: getMainFile
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static File getMainFile(IUser user){
return new File(config.SAVEDIR+'/'+user.getID()+"/main");
}
示例8: switchSlot
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static void switchSlot(IUser user, byte slot){
String ID = user.getID();
if(playerMap.containsKey(ID)) playerMap.remove(ID).saveData();
getPlayer(user, slot);
return;
}
示例9: User
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
/**
* Creates a new user object based on an IUser
*
* @param user The IUser to base this object on
*/
User(IUser user) {
roles.add("Default");
userID = user.getID();
}