當前位置: 首頁>>代碼示例>>Java>>正文


Java User.getDiscriminator方法代碼示例

本文整理匯總了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 + ">";
}
 
開發者ID:GloriousEggroll,項目名稱:quorrabot,代碼行數:11,代碼來源:DiscordEvent.java

示例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());
}
 
開發者ID:IANetworks,項目名稱:Ducky-Mc-Duckerson,代碼行數:5,代碼來源:CommandStructure.java

示例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() : "") + ">";
}
 
開發者ID:Panzer1119,項目名稱:Supreme-Bot,代碼行數:7,代碼來源:Standard.java

示例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();
}
 
開發者ID:EndlessBot,項目名稱:Endless,代碼行數:43,代碼來源:About.java

示例5: getFullUser

import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public static String getFullUser(User user)
{
    return user.getName() + "#" + user.getDiscriminator();
}
 
開發者ID:thebrightspark,項目名稱:MDC-Discord-Bot,代碼行數:5,代碼來源:Util.java

示例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 + ">";
}
 
開發者ID:natanbc,項目名稱:GabrielBot,代碼行數:6,代碼來源:DBotsCommand.java


注:本文中的net.dv8tion.jda.core.entities.User.getDiscriminator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。