本文整理匯總了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();
}
示例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()));
}
}
示例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;
}
示例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());
}
示例5: MemberComposite
import net.dv8tion.jda.core.entities.User; //導入方法依賴的package包/類
public MemberComposite(@Nonnull Guild guild, @Nonnull User user) {
this(guild.getIdLong(), user.getIdLong());
}