當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。