本文整理汇总了Java中org.pircbotx.hooks.events.KickEvent类的典型用法代码示例。如果您正苦于以下问题:Java KickEvent类的具体用法?Java KickEvent怎么用?Java KickEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KickEvent类属于org.pircbotx.hooks.events包,在下文中一共展示了KickEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent event)
{
final Channel channel = event.getChannel();
final User kickedUser = event.getRecipient();
final User kicker = event.getUser();
if (kickedUser.getNick().equals(foxbot.bot().getNick()))
{
if (foxbot.getConfig().getAutoRejoinOnKick() && !foxbot.getPermissionManager().userHasQuietPermission(kicker, "bot.allowkick"))
{
new Timer().schedule(
new TimerTask()
{
@Override
public void run()
{
foxbot.bot().sendIRC().joinChannel(channel.getName());
}
},
TimeUnit.SECONDS.toMillis(foxbot.getConfig().getAutoRejoinDelay())
);
}
}
}
示例2: createFrom
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
public static Line createFrom(DatabaseManager manager, KickEvent e) {
return manager.create(Line.class, obj -> {
fillFromGenericChannelUserEvent(obj, e);
obj.type = Type.Kick;
obj.nick2 = e.getRecipient().getNick();
obj.content = e.getReason();
});
}
示例3: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent event) throws Exception
{
if(event.getRecipient().getNick().equals(Core.bot.getNick()))
warn("Bot kicked from " + event.getChannel().getName() + " for \"" + event.getReason() + "\"");
else
info(event.getRecipient().getNick() + " was kicked from " + event.getChannel().getName() + " for \"" + event.getReason() + "\"");
}
示例4: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent event) throws Exception {
super.onKick(event);
if (!event.getUser().getNick().equalsIgnoreCase(bot.getSettings().getTwitchUsername())) {
this.bot.userParted(event.getUser().getNick(), true);
}
}
示例5: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
public void onKick(KickEvent event) throws Exception {
IRCUtils.sendRelayMessage(event.getBot(), event.getChannel(), IRCUtils.noPing(event.getRecipient().getNick()) + " (" + event.getRecipientHostmask().getLogin() + "@" + event.getRecipientHostmask().getHostname() +") was kicked by " + IRCUtils.noPing(event.getUser().getNick()) + " (" + event.getUserHostmask().getLogin() + "@" + event.getUserHostmask().getHostname() +") (" + event.getReason() + ")");
Record rec = DatabaseUtils.getChannelProperty(IRCUtils.getNetworkNameByNetwork(event.getBot()), event.getChannel().getName(), "kickrejoin");
if (!(rec != null && rec.getValue(Channelproperty.CHANNELPROPERTY.VALUE).equalsIgnoreCase("false"))) {
Channel channel = event.getChannel();
PircBotX network = event.getBot();
User user = event.getUser();
if (event.getRecipient().getNick().equals(network.getNick())) {
int tries = 0;
event.getBot().sendIRC().joinChannel(channel.getName());
while (tries < 10 && !network.getUserBot().getChannels().contains(channel)) {
event.getBot().sendIRC().joinChannel(channel.getName());
tries++;
TimeUnit.SECONDS.sleep(5);
}
Record rec2 = DatabaseUtils.getChannelProperty(IRCUtils.getNetworkNameByNetwork(event.getBot()), event.getChannel().getName(), "funmsg");
if (rec2 == null)
return;
if (rec2.getValue(Channelproperty.CHANNELPROPERTY.VALUE).equalsIgnoreCase("true")) {
if (network.getUserBot().getChannels().contains(channel) && !user.getNick().equals(network.getNick())) {
if (IRCUtils.checkIfCanKick(channel, network, user)) {
IRCUtils.sendKick(network.getUserBot(), user, network, event.getChannel(), "┻━┻ ︵ ¯\\ (ツ)/¯ ︵ ┻━┻");
} else {
IRCUtils.sendAction(user, network, channel, "kicks " + IRCUtils.noPing(user.getNick()) + " (┻━┻ ︵ ¯\\ (ツ)/¯ ︵ ┻━┻)", "");
}
}
}
}
}
}
示例6: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent e) {
if (!Config.linkChannels) return;
if (e.getRecipient().getNick().equals(e.getBot().getNick())) return;
String message = Config.itiKick;
final String reason = (e.getReason().isEmpty()) ? Config.defaultReason : e.getReason();
message = message.replace("{server}", e.getBot().getConfiguration().getServerHostname());
message = message.replace("{name}", e.getRecipient().getNick());
message = message.replace("{channel}", e.getChannel().getName());
message = message.replace("{message}", reason);
message = message.replace("{kicker}", e.getUser().getNick());
plugin.bh.sendMessageToOtherChannels(message, e.getChannel());
}
示例7: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent e) {
if (!Config.rejoinOnKick) return;
if (!e.getRecipient().getNick().equalsIgnoreCase(e.getBot().getNick())) return;
try {
Thread.sleep(Config.rejoinWaitTime * 1000L);
} catch (InterruptedException ignored) {
}
e.getBot().sendIRC().joinChannel(e.getChannel().getName());
}
示例8: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent e) {
String message = Config.itbKick;
final String reason = (e.getReason().isEmpty()) ? Config.defaultReason : e.getReason();
message = message.replace("{name}", e.getRecipient().getNick());
message = message.replace("{message}", reason);
message = message.replace("{channel}", e.getChannel().getName());
message = message.replace("{kicker}", e.getUser().getNick());
message = replaceVarsGeneric(e, message);
plugin.sendToMinecraft(message);
}
示例9: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
/**
* Occurs when a user is kicked from the game channel.
* @param event
*/
@Override
public void onKick(KickEvent<PircBotX> event) {
if (event.getChannel().equals(channel)) {
processKick(event.getRecipient());
}
}
示例10: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(final KickEvent<PircBotX> e) {
if (!e.getUser().getNick().equals(rb.getBot().getUserBot().getNick())) {
this.partIfLessThan(e.getChannel(), 2);
return;
}
List<String> channels = rb.getConfig().getChannels();
if (channels.contains(e.getChannel().getName())) channels.remove(e.getChannel().getName());
rb.getConfig().setChannels(channels);
rb.getLogger().info("Kicked from " + e.getChannel().getName() + ".");
}
示例11: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
public void onKick (KickEvent e) throws InterruptedException {
if (e.getRecipient().getNick().equals(actualBotName)) {
String channel = e.getChannel().getName();
Thread.sleep(500);
e.getBot().sendIRC().joinChannel(channel);
Thread.sleep(600);
e.getBot().sendIRC().message(channel, "Ah-Ha! You thought you could get rid of me, but nobody can win over me MUAHAHAHAHAHAHAHAA!");
}
}
示例12: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(final KickEvent event) {
RavenBot.getInstance().sendMessage(event.getChannel().getName(), getResponse());
}
示例13: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
protected void onKick(KickEvent e) {
Line.createFrom(manager.app.databaseManager, e);
}
示例14: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent event) {
logger.notice(event.getSource().getNick() + "!" + event.getSource().getLogin() + " KICKED " + event.getRecipient().getNick() + "!" + event.getRecipient().getLogin() + "(" + event.getReason() + ")");
}
示例15: onKick
import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(KickEvent<PircBotX> event) throws Exception {
IdleBot.botref.penalize(event.getRecipient(), 450);
super.onKick(event);
}