当前位置: 首页>>代码示例>>Java>>正文


Java Guild.getIdLong方法代码示例

本文整理汇总了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();
    }

}
 
开发者ID:IANetworks,项目名称:Ducky-Mc-Duckerson,代码行数:29,代码来源:TesterTitleItem.java

示例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();
    }
}
 
开发者ID:IANetworks,项目名称:Ducky-Mc-Duckerson,代码行数:13,代码来源:TesterTitleItem.java

示例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;
}
 
开发者ID:JessWalters,项目名称:Vinny-Redux,代码行数:15,代码来源:Bot.java

示例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();
    }
}
 
开发者ID:michidk,项目名称:GGD-Discord-Bot,代码行数:9,代码来源:Main.java

示例5: GuildBotComposite

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public GuildBotComposite(@Nonnull Guild guild, long botId) {
    this(guild.getIdLong(), botId);
}
 
开发者ID:napstr,项目名称:SqlSauce,代码行数:4,代码来源:GuildBotComposite.java

示例6: MemberComposite

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的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.Guild.getIdLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。