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


Java ActivityType类代码示例

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


ActivityType类属于sx.blah.discord.handle.obj包,在下文中一共展示了ActivityType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handle

import sx.blah.discord.handle.obj.ActivityType; //导入依赖的package包/类
@Override
public void handle(ReadyEvent event){
    //Initialize database connection pool
    Karren.log.info("Initializing Yank database pool");
    Properties dbSettings = new Properties();
    dbSettings.setProperty("jdbcUrl", "jdbc:mysql://" + conf.getSqlhost() + ":" + conf.getSqlport() + "/" + conf.getSqldb() + "?useUnicode=true&characterEncoding=UTF-8");
    dbSettings.setProperty("username", conf.getSqluser());
    dbSettings.setProperty("password", conf.getSqlpass());

    Yank.setupDefaultConnectionPool(dbSettings);

    //Start auto reminder
    Karren.bot.getAr().start();

    //Start ChannelMonitor
    Karren.bot.getCm().start();

    if(!Karren.conf.isTestMode())
        event.getClient().changePresence(StatusType.ONLINE, ActivityType.PLAYING, "KarrenSama Ver." + Karren.botVersion);
    else
        event.getClient().changePresence(StatusType.ONLINE, ActivityType.PLAYING, "TEST MODE");
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:23,代码来源:ConnectCommand.java

示例2: handle

import sx.blah.discord.handle.obj.ActivityType; //导入依赖的package包/类
@Override
public void handle(ReconnectSuccessEvent reconnectSuccessEvent) {
    Karren.bot.getAr().setSuspend(false);

    try {
        reconnectSuccessEvent.getClient().changePresence(StatusType.ONLINE, ActivityType.PLAYING, "KarrenSama Ver." + Karren.botVersion);
    } catch (DiscordException e) {
        Karren.log.error(e.getErrorMessage());
    }
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:11,代码来源:ReconnectListener.java

示例3: updatePresence

import sx.blah.discord.handle.obj.ActivityType; //导入依赖的package包/类
public static void updatePresence() {
	Shadbot.getClient().changePresence(StatusType.ONLINE, ActivityType.PLAYING,
			String.format("%shelp | %s", Config.DEFAULT_PREFIX, TextUtils.getTip()));
}
 
开发者ID:Shadorc,项目名称:Shadbot,代码行数:5,代码来源:BotUtils.java

示例4: onReady

import sx.blah.discord.handle.obj.ActivityType; //导入依赖的package包/类
@EventSubscriber
public void onReady(ReadyEvent event) {
    LOG.info(Constants.name + "Bot connecté !");

    LOG.info("Ajout des différents listeners");
    ClientConfig.DISCORD().getDispatcher().registerListener(new GuildCreateListener());
    ClientConfig.DISCORD().getDispatcher().registerListener(new GuildLeaveListener());
    ClientConfig.DISCORD().getDispatcher().registerListener(new GuildUpdateListener());
    ClientConfig.DISCORD().getDispatcher().registerListener(new ChannelDeleteListener());
    ClientConfig.DISCORD().getDispatcher().registerListener(new TrackFinishListener());

    LOG.info("Check des guildes");
    for(IGuild guild : ClientConfig.DISCORD().getGuilds())
        if (Guild.getGuilds().containsKey(guild.getStringID())
                && !guild.getName().equals(Guild.getGuild(guild).getName()))
            Guild.getGuild(guild).setName(guild.getName());
        else
            ClientConfig.DISCORD().getDispatcher().dispatch(new GuildCreateEvent(guild));

    // Check des guildes éventuellement supprimé durant l'absence
    List<String> ids =  new ArrayList<>(Guild.getGuilds().keySet());

    for(String guildID : ids)
        if (ClientConfig.DISCORD().getGuildByID(Long.parseLong(guildID)) == null) {
            LOG.info(Guild.getGuilds().get(guildID).getName() + " a supprimé "
                    + Constants.name + " en son absence.");
            Guild.getGuilds().get(guildID).removeToDatabase();
        }

    // Joue à...
    ClientConfig.DISCORD().changePresence(StatusType.ONLINE, ActivityType.WATCHING, Constants.discordInvite);

    LOG.info("Ecoute des flux RSS du site Dofus...");
    RSSFinder.start();

    LOG.info("Récupération des positions de portails...");
    PortalFinder.start();

    LOG.info("Lancement du calendrier Almanax...");
    AlmanaxCalendar.start();

    LOG.info("Connexion à l'API Twitter...");
    TwitterFinder.start();

    LOG.info("Ecoute des messages...");
    ClientConfig.DISCORD().getDispatcher().registerListener(new MessageListener());
}
 
开发者ID:Kaysoro,项目名称:KaellyBot,代码行数:48,代码来源:ReadyListener.java


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