当前位置: 首页>>代码示例>>Java>>正文


Java IUser.getID方法代码示例

本文整理汇总了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();
}
 
开发者ID:quanticc,项目名称:ugc-bot-redux,代码行数:5,代码来源:DiscordUser.java

示例2: PrivateChannelUser

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public PrivateChannelUser(IUser u) {
    super.userID = u.getID();
}
 
开发者ID:ArsenArsen,项目名称:ABot,代码行数:4,代码来源:PrivateChannelUser.java

示例3: User

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
User(IUser user) {
    userID = user.getID();
    groups.add("Default");
}
 
开发者ID:ArsenArsen,项目名称:FlareBot,代码行数:5,代码来源:User.java

示例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;
}
 
开发者ID:chrislo27,项目名称:Baristron,代码行数:51,代码来源:OccurrencesCommand.java

示例5: convertUser

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String convertUser(IUser user) {
	return user.getName() + "#" + user.getDiscriminator() + " (" + user.getID() + ")";
}
 
开发者ID:chrislo27,项目名称:Baristron,代码行数:4,代码来源:ModLog.java

示例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);
}
 
开发者ID:Coolway99,项目名称:Discord-Pokebot,代码行数:4,代码来源:Pokebot.java

示例7: getMainFile

import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static File getMainFile(IUser user){
	return new File(config.SAVEDIR+'/'+user.getID()+"/main");
}
 
开发者ID:Coolway99,项目名称:Discord-Pokebot,代码行数:4,代码来源:Pokebot.java

示例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;
}
 
开发者ID:Coolway99,项目名称:Discord-Pokebot,代码行数:7,代码来源:PlayerHandler.java

示例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();
}
 
开发者ID:ArsenArsen,项目名称:ABot,代码行数:10,代码来源:User.java


注:本文中的sx.blah.discord.handle.obj.IUser.getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。