本文整理汇总了Java中net.dv8tion.jda.core.entities.Guild.getIdLong方法的典型用法代码示例。如果您正苦于以下问题:Java Guild.getIdLong方法的具体用法?Java Guild.getIdLong怎么用?Java Guild.getIdLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.dv8tion.jda.core.entities.Guild
的用法示例。
在下文中一共展示了Guild.getIdLong方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
@Override
public void execute(Guild guild, Member member, MessageChannel channel, Integer amount) {
Long guildID = guild.getIdLong();
Long userID = member.getUser().getIdLong();
try {
UserProfile up = dbMan.getUserProfile(guildID, userID);
HashMap<Long, Item> invList = up.getInv();
boolean hasItem = false;
for (Item item : invList.values()) {
if (item.getInvID() == invID) {
hasItem = true;
break;
}
}
if (hasItem) {
channel.sendMessage(localize(channel, "item.tester_title.user_already_has_title", member.getEffectiveName())).queue();
} else {
dbMan.addItemToUser(guildID, userID, this);
channel.sendMessage(localize(channel, "item.tester_title.buy", member.getEffectiveName(), this.getLocalizedName(channel))).queue();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
示例2: executeUse
import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
@Override
public void executeUse(Guild guild, Member member, MessageChannel channel) {
Long guildID = guild.getIdLong();
Long userID = member.getUser().getIdLong();
try {
// TODO: localize title?
dbMan.setUserTitle(guildID, userID, this.getName());
channel.sendMessage(localize(channel, "item.tester_title.title_set", this.getLocalizedName(channel))).queue();
} catch (SQLException e) {
e.printStackTrace();
}
}
示例3: getHandler
import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public VoiceSendHandler getHandler(Guild guild) {
VoiceSendHandler handler;
if (guild.getAudioManager().getSendingHandler() == null) {
AudioPlayer player = manager.createPlayer();
// TODO: Add Default Volume from DB
handler = new VoiceSendHandler(guild.getIdLong(), player, this);
player.addListener(handler);
guild.getAudioManager().setSendingHandler(handler);
}
else {
handler = (VoiceSendHandler) guild.getAudioManager().getSendingHandler();
}
return handler;
}
示例4: leaveServerIfUnauthorized
import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public static void leaveServerIfUnauthorized(Guild guild) {
long serverId = guild.getIdLong();
if (serverId != ConfigManager.getConfig().getServer()) {
System.out.println("Bot was added to unauthorized server " + serverId + "!");
guild.leave().queue();
}
}
示例5: GuildBotComposite
import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public GuildBotComposite(@Nonnull Guild guild, long botId) {
this(guild.getIdLong(), botId);
}
示例6: MemberComposite
import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public MemberComposite(@Nonnull Guild guild, @Nonnull User user) {
this(guild.getIdLong(), user.getIdLong());
}