本文整理汇总了Java中sx.blah.discord.handle.obj.IUser.getDiscriminator方法的典型用法代码示例。如果您正苦于以下问题:Java IUser.getDiscriminator方法的具体用法?Java IUser.getDiscriminator怎么用?Java IUser.getDiscriminator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sx.blah.discord.handle.obj.IUser
的用法示例。
在下文中一共展示了IUser.getDiscriminator方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asContent
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
@Override
public String asContent(Map<String, Object> dataMap) {
String guildSpec = (String) dataMap.get("guilds");
List<String> guilds = null;
if (guildSpec != null) {
guilds = Arrays.asList(guildSpec.split("[,;]"));
}
if (guilds == null) {
return null;
}
if (guilds.contains(getSource().getGuild().getStringID())) {
IUser user = getSource().getUser();
String imagesSpec = (String) dataMap.get("images");
String image = "";
if (imagesSpec != null) {
String[] images = imagesSpec.split(";");
image = "\n" + images[random.nextInt(images.length)];
}
String emojiSpec = (String) dataMap.get("emoji");
String emoji = emoji("angel");
if (emojiSpec != null) {
String[] emojis = emojiSpec.split(";");
emoji = "\n" + emojis[random.nextInt(emojis.length)];
if (emoji.startsWith("alias:")) {
emoji = emoji(emoji);
}
}
return user.getName() + "#" + user.getDiscriminator() + " " + emoji + image;
} else {
return null;
}
}
示例2: asContent
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
@Override
public String asContent(Map<String, Object> dataMap) {
String guildSpec = (String) dataMap.get("guilds");
List<String> guilds = null;
if (guildSpec != null) {
guilds = Arrays.asList(guildSpec.split("[,;]"));
}
if (guilds == null) {
return null;
}
if (guilds.contains(getSource().getGuild().getStringID())) {
IUser user = getSource().getUser();
String imagesSpec = (String) dataMap.get("images");
String image = "";
if (imagesSpec != null) {
String[] images = imagesSpec.split(";");
image = "\n" + images[random.nextInt(images.length)];
}
String emojiSpec = (String) dataMap.get("emoji");
String emoji = emoji("hammer");
if (emojiSpec != null) {
String[] emojis = emojiSpec.split(";");
emoji = "\n" + emojis[random.nextInt(emojis.length)];
if (emoji.startsWith("alias:")) {
emoji = emoji(emoji);
}
}
return user.getName() + "#" + user.getDiscriminator() + " " + emoji + image;
} else {
return null;
}
}
示例3: Songs
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public Songs(Track track) {
title = track.getTrack().getInfo().title;
identifier = track.getTrack().getIdentifier();
requester = track.getMeta().getOrDefault("requester", "dick").toString();
length = track.getTrack().getDuration();
progress = track.getTrack().getPosition();
IUser user = FlareBot.getInstance().getClient().getUserByID(requester);
if (user != null) {
discrim = user.getDiscriminator();
name = user.getName();
if (user.getAvatar() != null)
avatar = user.getAvatarURL();
}
}
示例4: getTag
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String getTag(IUser user) {
return user.getName() + '#' + user.getDiscriminator();
}
示例5: convertUser
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String convertUser(IUser user) {
return user.getName() + "#" + user.getDiscriminator() + " (" + user.getID() + ")";
}
示例6: getUserTag
import sx.blah.discord.handle.obj.IUser; //导入方法依赖的package包/类
public static String getUserTag (IUser user) {
return user.getName() + "#" + user.getDiscriminator();
}