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


Java ConnectEvent类代码示例

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


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

示例1: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent event)
{
	try
	{
		Logging.info("Getting default channels");
		Startup.setDefaultChans();
		Logging.info("Joining default channels");
		Core.bot.joinDefaults();
		Logging.info("Connected to server");
	}
	catch(Exception e)
	{
		Logging.stackTrace(e);
	}
}
 
开发者ID:bl4ckscor3,项目名称:bl4ckb0t,代码行数:17,代码来源:Listener.java

示例2: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<IdleBot> event) throws Exception {
	IdleBot.botref.loadPlayers();
	if (IdleBot.botref.findPlayer("IdleMaster") == null) {

		IdleMaster i = new IdleMaster();

		IdleBot.botref.getPlayersRaw().add(i);

		IdleBot.botref.savePlayers(false);
		
		i.loggedIn = true;

		i.fromSerialize();
	} else {
		Player p = IdleBot.botref.findPlayer("IdleMaster");
		IdleBot.botref.handleLogin(event.getBot().getUserBot(), p);
	}
	super.onConnect(event);
	
	IdleBot.botref.generateMonsters();
}
 
开发者ID:kellyirc,项目名称:idlemaster,代码行数:23,代码来源:SaveListener.java

示例3: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent event)
{
    if (!ConfReader.getInstance().isIdentifyEnabled() ||
            event.getBot().isNickservIdentified()) return;

    event.getBot().send().identify(
            ConfReader.getInstance().getNickserv_passwd());
}
 
开发者ID:MadCoderZ,项目名称:NewsBotIRC,代码行数:10,代码来源:IRCListener.java

示例4: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<PircBotX> event) throws Exception {
    if(event.getBot().getBotId() == 1) {
        event.getBot().sendCAP().request("twitch.tv/membership");
        event.getBot().sendCAP().request("twitch.tv/tags");
    }
}
 
开发者ID:lorddusk,项目名称:DuskBot,代码行数:8,代码来源:HooksWhisperer.java

示例5: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<PircBotX> event) throws Exception {
    if (event.getBot().getBotId() == 1) {
        event.getBot().sendCAP().request("twitch.tv/commands");
    } else {
        System.out.println("Bot started and joined " + Defaults.getStreamer() + "'s channel.\nPlease enjoy DuskBot");
        MessageSending.sendNormalMessage("Bot started. Please enjoy Chirp/DuskBot");
        if (!Objects.equals(Defaults.latestVersion(), Defaults.VERSION)) {
            MessageSending.sendWhisper(Defaults.getStreamer(), "You are running " + Defaults.VERSION + ". But the latest version is " + Defaults.latestVersion() + ". Please consider updating.");
        }
    }
}
 
开发者ID:lorddusk,项目名称:DuskBot,代码行数:13,代码来源:Hooks.java

示例6: buildNewBot

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
protected Bot buildNewBot(CountDownLatch latch) {
	Configuration.Builder cfgb = new Configuration.Builder()
		.setBotFactory(new BotFactory(){
			@Override
			public InputParser createInputParser(PircBotX bot) {
				return new SkylarkInputParser(bot);
			}
		})
		.setEncoding(CHARSET)
		.setName(botName)
		.setAutoNickChange(true)
		.setMessageDelay(messageDelay)
		.setCapEnabled(true)
		.addCapHandler(new EnableCapHandler("extended-join", true))
		.addCapHandler(new EnableCapHandler("account-notify", true))
		.setAutoReconnect(true)
		.addListener(new ListenerAdapter(){
			@Override
			public void onConnect(ConnectEvent event) throws Exception {
				latch.countDown();
			}
		});
	
	if (port == null)
		cfgb.addServer(host);
	else
		cfgb.addServer(host, port);
	
	PluginManager pluginManager = serverManager.app.pluginManager;
	pluginManager.plugins.iterate(plugin -> {
		if (plugin instanceof ListenerPlugin)
			cfgb.addListener(((ListenerPlugin)plugin).listener);
	});
	
	return new Bot(cfgb.buildConfiguration(), this);
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:37,代码来源:BotManager.java

示例7: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
public void onConnect(ConnectEvent event) throws Exception {
    String NickServCommand = DatabaseUtils.getNetwork(IRCUtils.getNetworkNameByNetwork(event.getBot())).getValue(NETWORKS.NICKSERVCOMMAND);
    String NickServNick = DatabaseUtils.getNetwork(IRCUtils.getNetworkNameByNetwork(event.getBot())).getValue(NETWORKS.NICKSERVNICK);
    if (NickServNick == null) {
        NickServNick = "NickServ";
    }
    if (NickServCommand != null) {
        event.getBot().sendRaw().rawLine("PRIVMSG " + NickServNick + " :" + NickServCommand);
    }
    TimeUnit.SECONDS.sleep(10);
    Registry.messageQueue.get(event.getBot()).addAll(Arrays.asList(StringUtils.split(DatabaseUtils.getNetwork(IRCUtils.getNetworkNameByNetwork(event.getBot())).getValue(NETWORKS.CHANNELS), ", ")).stream().map(channel -> ("JOIN :" + channel)).collect(Collectors.toList()));
    TimeUnit.SECONDS.sleep(10);
        ListenerManager listenerManager = event.getBot().getConfiguration().getListenerManager();
        listenerManager.getListeners().stream().filter(lis -> !(lis instanceof ConnectListener || lis instanceof CoreHooks)).forEach(listener->listenerManager.removeListener(listener));
        listenerManager.addListener(new ChanMsgListener());
        listenerManager.addListener(new PartListener());
        listenerManager.addListener(new PrivMsgListener());
        listenerManager.addListener(new KickListener());
        listenerManager.addListener(new BanListener());
        listenerManager.addListener(new JoinListener());
        listenerManager.addListener(new FunMsgListener());
        listenerManager.addListener(new RelayMsgListener());
        listenerManager.addListener(new InviteListener());
        listenerManager.addListener(new TellMsgListener());
        listenerManager.addListener(new NoticeListener());
        listenerManager.addListener(new ActionListener());
 listenerManager.addListener(new CTCPListener());
    IRCUtils.sendLogChanMsg(event.getBot(), "[Connection Successful]");
}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:30,代码来源:ConnectListener.java

示例8: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent event) {
	DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss aa");
	Date date = new Date();
   	String curTime = dateFormat.format(date);
   	logger.warning("ARADIABOT CONNECTED @ " + curTime);
	email.sendEmail("[email protected]", "NOTICE: Aradiabot Connected", "Aradiabot connected to the server @ " + curTime);
}
 
开发者ID:KazeEspada,项目名称:IRCBot,代码行数:9,代码来源:ConnectionListener.java

示例9: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
/**
 * When Geffy connects to IRC, join all channels listed in Reference.joinedChannels.
 */
public void onConnect(ConnectEvent event) throws Exception{
	for(String channel : Reference.joinedChannels){
		Geffy.bot.sendIRC().joinChannel(channel);
	}
}
 
开发者ID:Geforce132,项目名称:Geffy,代码行数:9,代码来源:EventListener.java

示例10: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<AgarBot> event) {
    log.info("Connected.");
}
 
开发者ID:likcoras,项目名称:A-Gario,代码行数:5,代码来源:CoreHook.java

示例11: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<SlyBot> event) throws Exception {
    //Start tasks that needs the bot to be connected
    event.getBot().onConnected();
}
 
开发者ID:Balonbal,项目名称:slybot,代码行数:6,代码来源:CommandListener.java

示例12: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<PircBotX> event) throws Exception {
  connectLatch.countDown();
  getLog().debug("Connected to {} as {}", bot.getConfiguration().getServerHostname(),
        bot.getConfiguration().getLogin());
}
 
开发者ID:OsuCelebrity,项目名称:OsuCelebrity,代码行数:7,代码来源:AbstractIrcBot.java

示例13: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<PircBotX> event) throws Exception {
  super.onConnect(event);
  // Enables whispers to be received
  event.getBot().sendRaw().rawLineNow("CAP REQ :twitch.tv/commands");
}
 
开发者ID:OsuCelebrity,项目名称:OsuCelebrity,代码行数:7,代码来源:TwitchWhisperBot.java

示例14: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent<PircBotX> event) throws Exception {
	super.onConnect(event); //To change body of generated methods, choose Tools | Templates.
}
 
开发者ID:bmoyer,项目名称:osrsclient,代码行数:5,代码来源:NetworkSession.java

示例15: onConnect

import org.pircbotx.hooks.events.ConnectEvent; //导入依赖的package包/类
@Override
public void onConnect(ConnectEvent event) {
	logger.notice("CONNECTED TO SERVER");
}
 
开发者ID:KazeEspada,项目名称:IRCBot,代码行数:5,代码来源:LogListener.java


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