本文整理匯總了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");
}
示例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());
}
}
示例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()));
}
示例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());
}