本文整理匯總了Java中net.dv8tion.jda.core.entities.User.getDiscriminator方法的典型用法代碼示例。如果您正苦於以下問題:Java User.getDiscriminator方法的具體用法?Java User.getDiscriminator怎麽用?Java User.getDiscriminator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.dv8tion.jda.core.entities.User
的用法示例。
在下文中一共展示了User.getDiscriminator方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DiscordEvent
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public DiscordEvent(User user) {
this.user = user;
this.channel = null;
this.channelName = null;
this.username = user.getName();
this.discrim = user.getDiscriminator();
this.senderId = user.getId();
this.sender = (username + "#" + discrim);
this.mention = "<@" + senderId + ">";
}
示例2: isBotAdminOwner
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
private boolean isBotAdminOwner(User author) {
String userwithDiscriminator = author.getName() + "#" + author.getDiscriminator(); //the libarey don't include a readily used readable username with descriminator
return (userwithDiscriminator.equals(botAdmin) && botAdmin != null) || (botOwner.getIdLong() == author.getIdLong());
}
示例3: getCompleteName
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public static final String getCompleteName(User user, boolean withId) {
if (user == null) {
return null;
}
return "<" + user.getName() + "#" + user.getDiscriminator() + (withId ? ":" + user.getId() : "") + ">";
}
示例4: execute
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
@Override
protected void execute(CommandEvent event)
{
Color color;
Config config = null;
if(event.isFromType(ChannelType.PRIVATE))
color = Color.decode("#33ff00");
else
color = event.getGuild().getSelfMember().getColor();
try
{
config = new Config();
}
catch(Exception e)
{
e.printStackTrace();
}
String title = ":information_source: Information about **"+event.getSelfUser().getName()+"**";
EmbedBuilder builder = new EmbedBuilder();
User owner = event.getJDA().getUserById(config.getOwnerId());
String ownername = owner.getName()+"#"+owner.getDiscriminator();
String ownerid = owner.getId();
builder.setDescription("Hi, I'm Endless! A multipurpose bot designed to be smart.\n"
+ "If you found a bug please contact my dad\n"
+ "("+Const.DEV+")!\n");
builder.addField(":bust_in_silhouette: Owner:", "**"+ownername+"** (**"+ownerid+"**)", false);
builder.addField("<:jda:325395909347115008> Library:", "Java Discord API (JDA) "+JDAInfo.VERSION+" and JDA Utilities "+JDAUtilitiesInfo.VERSION, false);
builder.addField("<:github:326118305062584321> GitHub:", "Did you found a bug? Want improve something?\n"
+ "Please open an Issue or create a PR on GitHub\n"
+ "**https://github.com/ArtutoGamer/Endless**\n", false);
builder.addField(":link: Support Guild:", "**[Support]("+Const.INVITE+")**\n", false);
builder.setFooter("Version: "+Const.VERSION+" | Latest Start", null);
builder.setColor(color);
builder.setTimestamp(event.getClient().getStartTime());
builder.setThumbnail(event.getSelfUser().getAvatarUrl());
event.getChannel().sendMessage(new MessageBuilder().append(title).setEmbed(builder.build()).build()).queue();
}
示例5: getFullUser
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public static String getFullUser(User user)
{
return user.getName() + "#" + user.getDiscriminator();
}
示例6: getName
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
private static String getName(long id) {
User u = GabrielBot.getInstance().getUserById(id);
if (u != null) return u.getName() + "#" + u.getDiscriminator();
return "<@" + id + ">";
}