本文整理汇总了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());
}