当前位置: 首页>>代码示例>>Java>>正文


Java KickEvent类代码示例

本文整理汇总了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())
            );
        }
    }
}
 
开发者ID:FoxDev,项目名称:FoxBot,代码行数:26,代码来源:UserListener.java

示例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();
	});
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:9,代码来源:Line.java

示例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() + "\"");
}
 
开发者ID:bl4ckscor3,项目名称:bl4ckb0t,代码行数:9,代码来源:Logging.java

示例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);
    }
}
 
开发者ID:RyanTheAllmighty,项目名称:AllmightyBot---Java,代码行数:8,代码来源:UserListener.java

示例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()) + " (┻━┻ ︵ ¯\\ (ツ)/¯ ︵ ┻━┻)", "");
                    }
                }
            }
        }
    }
}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:31,代码来源:KickListener.java

示例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());
}
 
开发者ID:RoyalDev,项目名称:RoyalIRC,代码行数:14,代码来源:IChatRelay.java

示例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());
}
 
开发者ID:RoyalDev,项目名称:RoyalIRC,代码行数:11,代码来源:IKickListener.java

示例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);
}
 
开发者ID:RoyalDev,项目名称:RoyalIRC,代码行数:12,代码来源:IChatListener.java

示例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());
    }
}
 
开发者ID:brrr2,项目名称:irccasino,代码行数:11,代码来源:CardGame.java

示例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() + ".");
}
 
开发者ID:RoyalDev,项目名称:RoyalBot,代码行数:12,代码来源:BaseListeners.java

示例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!");

        }
    }
 
开发者ID:Walkersneps,项目名称:SnepsBotX,代码行数:17,代码来源:OnKick.java

示例12: onKick

import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
public void onKick(final KickEvent event) {
    RavenBot.getInstance().sendMessage(event.getChannel().getName(), getResponse());
}
 
开发者ID:MCUpdater,项目名称:RavenBot,代码行数:5,代码来源:KickHandler.java

示例13: onKick

import org.pircbotx.hooks.events.KickEvent; //导入依赖的package包/类
@Override
protected void onKick(KickEvent e) {
	Line.createFrom(manager.app.databaseManager, e);
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:5,代码来源:HistoryPlugin.java

示例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() + ")");
}
 
开发者ID:KazeEspada,项目名称:IRCBot,代码行数:5,代码来源:LogListener.java

示例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);
}
 
开发者ID:kellyirc,项目名称:idlemaster,代码行数:6,代码来源:PenaltyListener.java


注:本文中的org.pircbotx.hooks.events.KickEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。