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


Java NickChangeEvent类代码示例

本文整理汇总了Java中org.pircbotx.hooks.events.NickChangeEvent的典型用法代码示例。如果您正苦于以下问题:Java NickChangeEvent类的具体用法?Java NickChangeEvent怎么用?Java NickChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NickChangeEvent类属于org.pircbotx.hooks.events包,在下文中一共展示了NickChangeEvent类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMessage

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onMessage(MessageEvent event) throws Exception {
    if (event.getMessage().startsWith(Helix.botPrefix + Commands.nick + " ") && event.getMessage().length() > (Commands.nick.length() + 2) && admins.contains(Util.getLogin(event.getUser()).toLowerCase()) && Util.isVerified(event.getUser())) {
        String newNick = event.getMessage().split(" ", 2)[1];
        WaitForQueue queue = new WaitForQueue(event.getBot());
        event.getBot().sendIRC().changeNick(newNick);
        while (true) {
            Event currentEvent = queue.waitFor(Arrays.asList(ServerResponseEvent.class, NickChangeEvent.class));
            if (currentEvent instanceof ServerResponseEvent) {
                switch (((ServerResponseEvent)currentEvent).getCode()) {
                    case 431:
                        event.getUser().send().notice("No nickname given");
                        return;
                    case 432:
                        event.getUser().send().notice("Erroneous nickname");
                        return;
                    case 433:
                        event.getUser().send().notice("Nickname is already in use");
                        return;
                }
            } else if (currentEvent instanceof NickChangeEvent && ((NickChangeEvent)currentEvent).getUser() == event.getBot().getUserBot()) return;
        }
    }
}
 
开发者ID:MatheusVigaro,项目名称:Helix,代码行数:25,代码来源:ListenerCommandNick.java

示例2: createFrom

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
public static Line createFrom(DatabaseManager manager, NickChangeEvent e, String channel) {
	return manager.create(Line.class, obj -> {
		fillFromEvent(obj, e);
		obj.channel = channel;
		obj.nick = e.getOldNick();
		obj.nick2 = e.getNewNick();
		obj.type = Type.Quit;
	});
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:10,代码来源:Line.java

示例3: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
protected void onNickChange(NickChangeEvent e) {
	IdentService service = e.<Bot>getBot().manager.getService(IdentService.class);
	NickServIdentMethod method = service.getMethod(NickServIdentMethod.class);
	if (method != null && method.isAvailable())
		method.onNickChange(e.getOldNick(), e.getNewNick());
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:8,代码来源:NickServIdentPlugin.java

示例4: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent e) {
    if (!Config.linkChannels) return;
    if (e.getUser().getNick().equals(e.getBot().getNick())) return;
    String message = Config.itiNick;
    message = message.replace("{server}", e.getBot().getConfiguration().getServerHostname());
    message = message.replace("{name}", e.getOldNick());
    message = message.replace("{newname}", e.getNewNick());
    plugin.bh.sendMessageToOtherServers(message, e.getBot().getConfiguration().getServerHostname());
}
 
开发者ID:RoyalDev,项目名称:RoyalIRC,代码行数:11,代码来源:IChatRelay.java

示例5: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent e) {
    if (e.getUser().getNick().equals(e.getBot().getNick())) return;
    String message = Config.itbNick;
    message = message.replace("{name}", e.getOldNick());
    message = message.replace("{newname}", e.getNewNick());
    message = replaceVarsGeneric(e, message);
    plugin.sendToMinecraft(message);
}
 
开发者ID:RoyalDev,项目名称:RoyalIRC,代码行数:10,代码来源:IChatListener.java

示例6: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent<IdleBot> event) throws Exception {

	super.onNickChange(event);

	IdleBot.botref.movePlayerToNewNick(event.getOldNick(),
			event.getNewNick());
}
 
开发者ID:kellyirc,项目名称:idlemaster,代码行数:9,代码来源:UserListener.java

示例7: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent<AgarBot> event) {
    User user = event.getUser();
    user.getChannels().forEach(channel -> handleNick(event.getBot(), user, channel));
}
 
开发者ID:likcoras,项目名称:A-Gario,代码行数:6,代码来源:BadnickHook.java

示例8: onNickChange

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

示例9: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent event) throws Exception
{
	info(event.getOldNick() + " changed their nick to " + event.getNewNick() + ".");
}
 
开发者ID:bl4ckscor3,项目名称:bl4ckb0t,代码行数:6,代码来源:Logging.java

示例10: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent event) {
    IRCUtils.sendRelayMessage(event.getBot(), null, IRCUtils.noPing(event.getOldNick()) + " is now known as " + IRCUtils.noPing(event.getNewNick()), event.getUser());
    IRCUtils.updateVoice(event.getBot(), event.getOldNick(), event.getUser());
}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:6,代码来源:RelayMsgListener.java

示例11: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent event) {
	logger.info(event.getOldNick() + "!" + event.getUser().getLogin() + " SET NICK " + event.getNewNick());
}
 
开发者ID:KazeEspada,项目名称:IRCBot,代码行数:5,代码来源:LogListener.java

示例12: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
@Override
public void onNickChange(NickChangeEvent<PircBotX> event) throws Exception {
	IdleBot.botref.penalize(event.getNewNick(), 40);
	super.onNickChange(event);
}
 
开发者ID:kellyirc,项目名称:idlemaster,代码行数:6,代码来源:PenaltyListener.java

示例13: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
/**
 * Occurs when a user changes nicks.
 * @param event nick change event
 */
@Override
public void onNickChange(NickChangeEvent<PircBotX> event){
    processNickChange(event.getUser(), event.getOldNick(), event.getNewNick());
}
 
开发者ID:brrr2,项目名称:irccasino,代码行数:9,代码来源:CardGame.java

示例14: onNickChange

import org.pircbotx.hooks.events.NickChangeEvent; //导入依赖的package包/类
protected void onNickChange(NickChangeEvent e) { } 
开发者ID:Shockah,项目名称:Skylark,代码行数:2,代码来源:ListenerPlugin.java


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