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


Java InviteEvent类代码示例

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


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

示例1: onInvite

import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
@Override
protected void onInvite(InviteEvent e) {
	BotManager manager = e.<Bot>getBot().manager;
	Bot foundBot = manager.bots.firstResult(bot -> {
		for (Channel channel : bot.getUserBot().getChannels()) {
			if (channel.getName().equals(e.getChannel()))
				return bot;
		}
		return null;
	});
	
	if (foundBot != null)
		return;
	
	manager.joinChannel(e.getChannel());
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:17,代码来源:BotControlPlugin.java

示例2: onInvite

import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
/**
 * Join the channel automatically when invited.
 *
 * @param event
 */
@Override
public void onInvite(InviteEvent event) {
    new OutputIRC(event.getBot()).joinChannel(event.getChannel());
    TitanBot.getLogger().info("Invited to channel " + event.getChannel() + " by " + event.getUser().getNick()
            + '@' + event.getUser().getHostmask() + ". Joining.");
}
 
开发者ID:MITBorg,项目名称:TitanBot,代码行数:12,代码来源:IRCListener.java

示例3: onInvite

import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
@Override
public void onInvite(InviteEvent event) throws Exception {
    IRCUtils.sendLogChanMsg(event.getBot(), "[INVITE] " + event.getChannel() + " by " + IRCUtils.noPing(event.getUserHostmask().getNick()));
    Record rec = DatabaseUtils.getNetworkProperty(IRCUtils.getNetworkNameByNetwork(event.getBot()), "joinoninvite");
    if (rec != null && rec.getValue(NETWORKPROPERTY.VALUE).equalsIgnoreCase("true")){
        Record netRecord = DatabaseUtils.getNetwork(IRCUtils.getNetworkNameByNetwork(event.getBot()));
        netRecord.setValue(NETWORKS.CHANNELS, DatabaseUtils.getNetwork(IRCUtils.getNetworkNameByNetwork(event.getBot())).getValue(NETWORKS.CHANNELS) + ", " + event.getChannel());
        DatabaseUtils.updateNetwork(netRecord);
        Registry.messageQueue.get(event.getBot()).add("JOIN :" + event.getChannel());
    }

}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:13,代码来源:InviteListener.java

示例4: onInvite

import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
@Override
public void onInvite(InviteEvent event)
{
    User user = foxbot.bot().getUserChannelDao().getUser(event.getUser());

    if (foxbot.getConfig().getAutoJoinOnInvite() && foxbot.getPermissionManager().userHasPermission(user, "bot.invite"))
    {
        foxbot.bot().sendIRC().joinChannel(event.getChannel());
        user.send().notice(String.format("Joined %s", event.getChannel()));
    }
}
 
开发者ID:FoxDev,项目名称:FoxBot,代码行数:12,代码来源:UserListener.java

示例5: onInvite

import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
@Override
public void onInvite(final InviteEvent<PircBotX> e) {
    e.getBot().sendIRC().joinChannel(e.getChannel());
    rb.getLogger().info("Invited to " + e.getChannel() + " by " + e.getUser() + ".");
}
 
开发者ID:RoyalDev,项目名称:RoyalBot,代码行数:6,代码来源:BaseListeners.java

示例6: onInvite

import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
@Override
public void onInvite(InviteEvent e) {

    u.p("Received an InviteEvent from " + e.getUser().getNick() + " to join #" + e.getChannel() + ". Joining it now!");

    e.getBot().sendIRC().message(e.getUser().getNick(), "Thanks for inviting me to your wonderful secret party! I'm joining right now!");
    e.getBot().sendIRC().joinChannel(e.getChannel());
    e.getBot().sendIRC().message(e.getChannel(), "Hello everyone!");

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

示例7: onInvite

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


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