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


Java User.getIdLong方法代碼示例

本文整理匯總了Java中net.dv8tion.jda.core.entities.User.getIdLong方法的典型用法代碼示例。如果您正苦於以下問題:Java User.getIdLong方法的具體用法?Java User.getIdLong怎麽用?Java User.getIdLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.dv8tion.jda.core.entities.User的用法示例。


在下文中一共展示了User.getIdLong方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handle

import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
@Override
public void handle(Message message, Event event, String[] args) throws Throwable {
    EmbedBuilder normal = kyoko.getAbstractEmbedBuilder().getNormalBuilder();
    Language l = kyoko.getI18n().getLanguage(message.getGuild());

    if (args.length == 1) {
        normal.setTitle(kyoko.getI18n().get(l, "hug.description"));
    } else {
        boolean skipme = false;

        if (message.getRawContent().startsWith(kyoko.getJda().getSelfUser().getAsMention())) {
            if (StringUtil.getOccurencies(message.getRawContent(), kyoko.getJda().getSelfUser().getAsMention()) == 1)
                skipme = true;
        }

        if (message.getMentionedUsers().isEmpty()) {
            //normal.setTitle(kyoko.getI18n().get(l, "hug.description"));
            normal.setTitle(String.format(kyoko.getI18n().get(l, "hug.someone"), args[1], message.getAuthor().getName()));
        } else {
            List<String> userlist = new ArrayList<>();
            for (User u : message.getMentionedUsers()) {
                if (skipme)
                    if (u.getIdLong() == kyoko.getJda().getSelfUser().getIdLong())
                        continue;
                userlist.add(u.getName());
            }
            normal.setTitle(String.format(kyoko.getI18n().get(l, "hug.someone"), String.join(", ", userlist), message.getAuthor().getName()));
        }
    }
    normal.setImage(URLUtil.readUrl(Constants.HUG_URL));

    message.getTextChannel().sendMessage(normal.build()).queue();
}
 
開發者ID:gabixdev,項目名稱:Kyoko,代碼行數:34,代碼來源:HugCommand.java

示例2: queueTrack

import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public void queueTrack(AudioTrack track, User user) {
    if(currentTrack == null) {
        currentTrack = new Track(track, user.getIdLong());
        guildMusicPlayer.player.startTrack(track, false);
    } else {
        tracks.offer(new Track(track, user.getIdLong()));
    }
}
 
開發者ID:natanbc,項目名稱:GabrielBot,代碼行數:9,代碼來源:TrackScheduler.java

示例3: getMutualGuilds

import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public List<Guild> getMutualGuilds(User user) {
    long id = user.getIdLong();
    List<Guild> guilds = new LinkedList<>();
    for(Guild g : getGuilds()) {
        if(g.getMemberById(id) != null) {
            guilds.add(g);
        }
    }
    return guilds;
}
 
開發者ID:natanbc,項目名稱:GabrielBot,代碼行數:11,代碼來源:GabrielBot.java

示例4: 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

示例5: MemberComposite

import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public MemberComposite(@Nonnull Guild guild, @Nonnull User user) {
    this(guild.getIdLong(), user.getIdLong());
}
 
開發者ID:napstr,項目名稱:SqlSauce,代碼行數:4,代碼來源:MemberComposite.java


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