本文整理汇总了Java中org.pircbotx.hooks.events.QuitEvent类的典型用法代码示例。如果您正苦于以下问题:Java QuitEvent类的具体用法?Java QuitEvent怎么用?Java QuitEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QuitEvent类属于org.pircbotx.hooks.events包,在下文中一共展示了QuitEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFrom
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
public static Line createFrom(DatabaseManager manager, QuitEvent e, String channel) {
return manager.create(Line.class, obj -> {
fillFromEvent(obj, e);
obj.channel = channel;
obj.nick = e.getUser().getNick();
obj.content = e.getReason();
obj.type = Type.Quit;
});
}
示例2: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
protected void onQuit(QuitEvent e) {
IdentService service = e.<Bot>getBot().manager.getService(IdentService.class);
NickServIdentMethod method = service.getMethod(NickServIdentMethod.class);
if (method != null && method.isAvailable())
method.onQuit(e.getUser().getNick());
}
示例3: testJoinQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Test
public void testJoinQuit() throws Exception {
ircBot.onJoin(new JoinEvent<PircBotX>(bot, channel, user));
assertTrue(ircBot.getOnlineUsers().contains("osuIrcUser"));
ircBot.onQuit(new QuitEvent<PircBotX>(bot, new UserChannelDaoSnapshot(bot, null, null, null,
null, null, null), new UserSnapshot(user), "no reason"));
assertFalse(ircBot.getOnlineUsers().contains("osuIrcUser"));
}
示例4: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent e) {
if (!Config.linkChannels) return;
if (e.getUser().getNick().equals(e.getBot().getNick())) return;
String message = Config.itiQuit;
final String reason = (e.getReason().isEmpty()) ? Config.defaultReason : e.getReason();
message = message.replace("{server}", e.getBot().getConfiguration().getServerHostname());
message = message.replace("{name}", e.getUser().getNick());
message = message.replace("{message}", reason);
plugin.bh.sendMessageToOtherServers(message, e.getBot().getConfiguration().getServerHostname());
}
示例5: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent e) {
final String reason = (e.getReason().isEmpty()) ? Config.defaultReason : e.getReason();
if (e.getUser().getNick().equals(e.getBot().getNick())) return;
String message = Config.itbQuit;
message = message.replace("{name}", e.getUser().getNick());
message = message.replace("{message}", reason);
message = replaceVarsGeneric(e, message);
plugin.sendToMinecraft(message);
}
示例6: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
public void onQuit(QuitEvent event) throws Exception {
if (Main.Login.containsKey(event.getUser().getNick())) {
Main.Login.remove(event.getUser().getNick());
}
if (Main.NotLoggedIn.contains(event.getUser().getNick())) Main.NotLoggedIn.remove(event.getUser().getNick());
}
示例7: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
protected void onQuit(QuitEvent e) {
Line.createFrom(manager.app.databaseManager, e);
}
示例8: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent event) throws Exception
{
info(event.getUser().getNick() + " quit: \"" + event.getReason() + "\"");
}
示例9: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent<PircBotX> event) throws Exception {
onlineUsers.remove(event.getUser().getNick());
}
示例10: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent event) {
IRCUtils.removeVoice(event.getBot(), event.getUser());
IRCUtils.sendRelayMessage(event.getBot(), null, IRCUtils.noPing(event.getUser().getNick()) + " (" + event.getUserHostmask().getLogin() + "@" + event.getUserHostmask().getHostname() +") quits " + " (" + event.getReason() + ")", event.getUser());
}
示例11: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent event) {
logger.notice(event.getUser().getNick() + "!" + event.getUser().getLogin() + "@" + event.getUser().getHostmask() + " QUIT " + "(" + event.getReason() + ")");
}
示例12: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent<PircBotX> event) throws Exception {
IdleBot.botref.penalize(event.getUser(), 15);
super.onQuit(event);
}
示例13: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent<IdleBot> event) throws Exception {
super.onQuit(event);
IdleBot.botref.handleLogout(event.getUser());
}
示例14: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
/**
* Occurs when a user disconnects from the IRC network.
* @param event quit event
*/
@Override
public void onQuit(QuitEvent<PircBotX> event){
processQuit(event.getUser());
}
示例15: onQuit
import org.pircbotx.hooks.events.QuitEvent; //导入依赖的package包/类
@Override
public void onQuit(QuitEvent event)
{
foxbot.getPermissionManager().removeAuthedUser(event.getUser());
}