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


Java IChannel.isDeleted方法代码示例

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


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

示例1: setSentryContext

import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public static void setSentryContext(IGuild guild, IUser user, IChannel chan, IMessage message){
    if (guild != null && ! guild.isDeleted()){
        Sentry.getContext().addTag("Guild", guild.getStringID() + " - " + guild.getName());
        if (chan != null && ! chan.isDeleted())
            Sentry.getContext().addTag("Channel", chan.getStringID() + " - " + chan.getName());
        else
            Sentry.getContext().addTag("Channel", "null");
    }
    else
        Sentry.getContext().addTag("Guild", "null");

    if (user != null)
        Sentry.getContext().addTag("User", user.getStringID() + " - " + user.getName());
    else
        Sentry.getContext().addTag("User", "null");
    if (message != null)
        Sentry.getContext().addTag("Message", message.getContent());
    else
        Sentry.getContext().addTag("Message", "null");
}
 
开发者ID:Kaysoro,项目名称:KaellyBot,代码行数:21,代码来源:ClientConfig.java

示例2: getRSSFinders

import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public synchronized static Map<String, RSSFinder> getRSSFinders(){
    if (rssFinders == null){
        rssFinders = new ConcurrentHashMap<>();

        Connexion connexion = Connexion.getInstance();
        Connection connection = connexion.getConnection();

        try {
            PreparedStatement query = connection.prepareStatement("SELECT id_guild, id_chan, last_update FROM RSS_Finder");
            ResultSet resultSet = query.executeQuery();

            while (resultSet.next()){
                String idChan = resultSet.getString("id_chan");
                String idGuild = resultSet.getString("id_guild");
                long lastUpdate = resultSet.getLong("last_update");

                IChannel chan = ClientConfig.DISCORD().getChannelByID(Long.parseLong(idChan));

                if (chan != null && ! chan.isDeleted())
                    rssFinders.put(chan.getStringID(), new RSSFinder(chan.getGuild().getStringID(), chan.getStringID(), lastUpdate));
                else {
                    new RSSFinder(idGuild, idChan).removeToDatabase();
                    LOG.info("Chan deleted : " + idChan);
                }
            }
        } catch (SQLException e) {
            ClientConfig.setSentryContext(null, null, null, null);
            LOG.error(e.getMessage());
        }
    }

    return rssFinders;
}
 
开发者ID:Kaysoro,项目名称:KaellyBot,代码行数:34,代码来源:RSSFinder.java

示例3: getTwitterChannels

import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public synchronized static Map<Long, TwitterFinder> getTwitterChannels(){
    if (twitterChannels == null) {
        twitterChannels = new ConcurrentHashMap<>();

        Connexion connexion = Connexion.getInstance();
        Connection connection = connexion.getConnection();

        try {
            PreparedStatement query = connection.prepareStatement("SELECT id_guild, id_chan FROM Twitter");
            ResultSet resultSet = query.executeQuery();

            while (resultSet.next()){
                long idChan = Long.parseLong(resultSet.getString("id_chan"));
                long idGuild = Long.parseLong(resultSet.getString("id_guild"));
                IChannel chan = ClientConfig.DISCORD().getChannelByID(idChan);
                if (chan != null && ! chan.isDeleted())
                    twitterChannels.put(chan.getLongID(), new TwitterFinder(idGuild, idChan));
                else {
                    new TwitterFinder(idGuild, idChan).removeToDatabase();
                    LOG.info("Chan deleted : " + idChan);
                }
            }
        } catch (SQLException e) {
            ClientConfig.setSentryContext(null, null, null, null);
            LOG.error(e.getMessage());
        }
    }
    return twitterChannels;
}
 
开发者ID:Kaysoro,项目名称:KaellyBot,代码行数:30,代码来源:TwitterFinder.java

示例4: getAlmanaxCalendars

import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public synchronized static Map<String, AlmanaxCalendar> getAlmanaxCalendars(){
    if (almanaxCalendar == null){
        almanaxCalendar = new HashMap<>();

        Connexion connexion = Connexion.getInstance();
        Connection connection = connexion.getConnection();

        try {
            PreparedStatement query = connection.prepareStatement("SELECT id_guild, id_chan FROM Almanax_Calendar");
            ResultSet resultSet = query.executeQuery();

            while (resultSet.next()){
                String idChan = resultSet.getString("id_chan");
                String idGuild = resultSet.getString("id_guild");

                IChannel chan = ClientConfig.DISCORD().getChannelByID(Long.parseLong(idChan));

                if (chan != null && ! chan.isDeleted())
                    almanaxCalendar.put(chan.getStringID(), new AlmanaxCalendar(chan.getGuild().getStringID(), chan.getStringID()));
                else {
                    new RSSFinder(idGuild, idChan).removeToDatabase();
                    LOG.info("Chan deleted : " + idChan);
                }
            }
        } catch (SQLException e) {
            ClientConfig.setSentryContext(null,null, null, null);
            LOG.error(e.getMessage());
        }
    }

    return almanaxCalendar;
}
 
开发者ID:Kaysoro,项目名称:KaellyBot,代码行数:33,代码来源:AlmanaxCalendar.java

示例5: getChannelLanguages

import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public synchronized static Map<Long, ChannelLanguage> getChannelLanguages(){
    if (channelLanguages == null) {
        channelLanguages = new ConcurrentHashMap<>();

        Connexion connexion = Connexion.getInstance();
        Connection connection = connexion.getConnection();

        try {
            PreparedStatement query = connection.prepareStatement("SELECT lang, id_chan FROM Channel_Language");
            ResultSet resultSet = query.executeQuery();

            while (resultSet.next()){
                long idChan = Long.parseLong(resultSet.getString("id_chan"));
                Language lang = Language.valueOf(resultSet.getString("lang"));
                IChannel chan = ClientConfig.DISCORD().getChannelByID(idChan);
                if (chan != null && ! chan.isDeleted())
                    channelLanguages.put(chan.getLongID(), new ChannelLanguage(lang, idChan));
                else {
                    new ChannelLanguage(lang, idChan).removeToDatabase();
                    LOG.info("Chan deleted : " + idChan);
                }
            }
        } catch (SQLException e) {
            ClientConfig.setSentryContext(null, null, null, null);
            LOG.error(e.getMessage());
        }
    }
    return channelLanguages;
}
 
开发者ID:Kaysoro,项目名称:KaellyBot,代码行数:30,代码来源:ChannelLanguage.java


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