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


Java Guild.getId方法代码示例

本文整理汇总了Java中net.dv8tion.jda.core.entities.Guild.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Guild.getId方法的具体用法?Java Guild.getId怎么用?Java Guild.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.dv8tion.jda.core.entities.Guild的用法示例。


在下文中一共展示了Guild.getId方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IGuildSettings

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
/**
 * Create a {@link GuildSettings} instance
 * @param guild The Guild those settings are being linked to.
 * @param bot A {@link LegendaryBot} instance.
 */
public IGuildSettings(Guild guild, LegendaryBot bot) {
    this.bot = bot;
    this.guildId = guild.getId();
    try {
        Connection conn = bot.getDatabase().getConnection();
        PreparedStatement statement = conn.prepareStatement("SELECT configName,configValue FROM guild_config WHERE guildId=?");
        statement.setString(1, guildId);
        ResultSet set = statement.executeQuery();
        while (set.next()) {
            settings.put(set.getString("configName"),set.getString("configValue"));
        }
        set.close();
        statement.close();
        conn.close();
    } catch (SQLException e) {
        e.printStackTrace();
        bot.getStacktraceHandler().sendStacktrace(e, "guildId:" + guildId);
    }
}
 
开发者ID:greatman,项目名称:legendarybot,代码行数:25,代码来源:IGuildSettings.java

示例2: getMusicManager

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
private GuildMusicManager getMusicManager(Guild guild)
{
    String guildId = guild.getId();
    GuildMusicManager mng = musicManagers.get(guildId);
    if (mng == null)
    {
        synchronized (musicManagers)
        {
            mng = musicManagers.get(guildId);
            if (mng == null)
            {
                mng = new GuildMusicManager(playerManager);
                mng.player.setVolume(DEFAULT_VOLUME);
                musicManagers.put(guildId, mng);
            }
        }
    }
    return mng;
}
 
开发者ID:ExidCuter,项目名称:JDodoBot,代码行数:20,代码来源:PlayerControl.java

示例3: Server

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public Server(Guild guild) {
	this.guild = guild;
	this.id = guild.getId();
	Utils.createDir(String.format("%s/%s", "app_data", id));
	qm = new QueueManager(id);
	cmds = new Commands();
	settings = new Settings(id);
	qm.getQueueList().forEach((q) -> q.getPlayersInQueue().forEach((u) -> updateActivityList(u)));
	
	// Insert guild into database
	Database.insertDiscordServer(guild.getIdLong(), guild.getName());
	// Insert members into database
	for(Member m : guild.getMembers()){
		Database.insertPlayer(m.getUser().getIdLong(), m.getEffectiveName());
		Database.insertPlayerServer(guild.getIdLong(), m.getUser().getIdLong());
	}
	
	banList = Database.queryGetBanList(guild.getIdLong());
	adminList = Database.queryGetAdminList(guild.getIdLong());
	
	startAFKTimer();
}
 
开发者ID:Implosions,项目名称:BullyBot,代码行数:23,代码来源:Server.java

示例4: resolveGuildId

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public static final long resolveGuildId(Guild guild, String guild_id) {
    if (guild != null && guild_id != null && (guild_id.equalsIgnoreCase("this") || guild_id.equalsIgnoreCase("current"))) {
        guild_id = guild.getId();
    } else if (guild_id != null && (guild_id.equalsIgnoreCase("user") || guild_id.equalsIgnoreCase("me"))) {
        return -1;
    } else if (guild_id == null || guild_id.equalsIgnoreCase("0")) {
        return 0;
    }
    return resolveGuildId(guild_id);
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:11,代码来源:Standard.java

示例5: GuildPlayer

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
@SuppressWarnings("LeakingThisInConstructor")
public GuildPlayer(JDA jda, Guild guild) {
    this.jda = jda;
    this.guildId = guild.getId();
    subscriber = streamCombiner.subscribe();

    AudioManager manager = guild.getAudioManager();
    manager.setSendingHandler(this);
}
 
开发者ID:Frederikam,项目名称:GensokyoBot,代码行数:10,代码来源:GuildPlayer.java

示例6: getMusicManager

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
/**
 * Initialize music manager if not found and set audio provider
 * @param g Guild
 * @return GuildMusicManager
 */
public GuildMusicManager getMusicManager(Guild g) {
	if (this.musicManager == null) {
		this.musicManager = new GuildMusicManager(AudioManager.getMasterManager(), g.getId());
		g.getAudioManager().setSendingHandler(this.musicManager.getSendHandler());
	}
	return this.musicManager;
}
 
开发者ID:paul-io,项目名称:momo-2,代码行数:13,代码来源:GuildObject.java

示例7: getCompleteName

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public static final String getCompleteName(Guild guild) {
    if (guild == null) {
        return null;
    }
    return "<" + guild.getName() + "#" + guild.getId() + ">";
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:7,代码来源:Standard.java

示例8: onReady

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
@Override
public void onReady(ReadyEvent event){
    String out = "\n This bot is running on the following servers: \n";

    for (Guild g : event.getJDA().getGuilds()){
        out += g.getName() + " (" + g.getId() + ")  \n";
    }

    System.out.println(out);

    STATICS.lastRestart = new Date();
    Vote.loadPolls(event.getJDA());




}
 
开发者ID:LeeDJD,项目名称:Amme,代码行数:18,代码来源:readyListener.java

示例9: run

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public Result run(String[] argsOrig, MessageReceivedEvent e) {
	
	//Check for proper argument length
	if (argsOrig.length < 1) {
		return new Result(Outcome.WARNING, ":warning: Please specify a guild.");
	}
	
	//Get guild
	String[] args = ArrayUtils.remove(MessageUtils.getContent(e.getMessage(), true), 0);
	Guild guild = null;
	if (args[0].matches(MessageUtils.idRegex)) {
		guild = DiscordUtils.getGuildById(args[0]);
	} else {
		return new Result(Outcome.ERROR, ":x: Not a valid guild!");
	}
	
	//Check for permissions
	if (!guild.getSelfMember().hasPermission(Permission.NICKNAME_CHANGE)) {
		return new Result(Outcome.WARNING, ":warning: No permissions!");
	}
	
	//Set the nickname
	String name = Config.getName();
	if (args.length > 1) {
		name = String.join(" ", ArrayUtils.remove(args, 0));
	}
	guild.getController().setNickname(guild.getSelfMember(), name).queue();
	
	//Log it
	EmbedBuilder eb = new EmbedBuilder();
	eb.setAuthor(e.getAuthor().getName() + " (" + e.getAuthor().getId() + ")",
		null, e.getAuthor().getAvatarUrl());
	String desc = null;
	if (args.length == 1) {
		desc = "**Reset nickname on `" + guild.getName() + "` (" + guild.getId() + "):**";
	} else {
		desc = "**Changed nickname on `" + guild.getName() + "` (" + guild.getId() + "):**\n" + name;
	}
	eb.setDescription(desc);
	eb.setThumbnail(guild.getIconUrl());
	MessageUtils.log(eb.build());
	
	return new Result(Outcome.SUCCESS);
}
 
开发者ID:Tisawesomeness,项目名称:Minecord,代码行数:45,代码来源:NameCommand.java

示例10: DefaultRole

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public DefaultRole(Role role, Guild guild) {
    this.guildID = guild.getId();
    this.roleID = role.getId();
}
 
开发者ID:ExidCuter,项目名称:JDodoBot,代码行数:5,代码来源:DefaultRole.java

示例11: buildServer

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
private String buildServer(Guild server) {
    return server.getName() + " (ID: " + server.getId() + ")";
}
 
开发者ID:avaire,项目名称:avaire,代码行数:4,代码来源:FeedbackCommand.java

示例12: getCacheString

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
public static String getCacheString(Guild guild) {
    return CACHE_STRING + guild.getId();
}
 
开发者ID:avaire,项目名称:avaire,代码行数:4,代码来源:PlaylistController.java

示例13: play

import net.dv8tion.jda.core.entities.Guild; //导入方法依赖的package包/类
private static void play(Guild guild, AudioTrack track, String trackUrl, String titleOverride, Member member) {
	TrackDetails details = new TrackDetails(trackUrl, titleOverride, member, track, guild.getId());
	AudioManager.getGuildManager(guild).trackManager.queue(details);
}
 
开发者ID:paul-io,项目名称:momo-2,代码行数:5,代码来源:GuildMusicManager.java


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