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


Java ActionEvent类代码示例

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


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

示例1: onGenericUserMessage

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
protected void onGenericUserMessage(GenericUserMessageEvent e) {
	if (e.getEvent() instanceof ActionEvent)
		return;
	
	CommandCall call = new CommandCall(e);
	try {
		PreparedCommandCall<?, ?> preparedCall = findCommandToCall(e);
		if (preparedCall == null)
			return;
		
		CommandResult<?> value = preparedCall.call(call);
		String output = value.toString();
		
		if (output != null) {
			List<String> lines = Arrays.asList(output.split("\\r?\\n|\\r"));
			call.respond(e.<Bot>getBot().manager.linebreakIfNeeded(lines, preparedCall.getLineLimit(call)));
		}
	} catch (CommandParseException ex) {
		call.respond(Arrays.asList(new String[] { ex.getMessage() }));
	}
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:23,代码来源:CommandsPlugin.java

示例2: onEvent

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onEvent(Event event) throws Exception {
	if (event instanceof GenericUserMessageEvent) {
		onGenericUserMessage((GenericUserMessageEvent)event);
	} else {
		if (event instanceof MessageEvent)
			onGenericUserMessage(new GenericUserMessageEvent((MessageEvent)event));
		else if (event instanceof ActionEvent)
			onGenericUserMessage(new GenericUserMessageEvent((ActionEvent)event));
		else if (event instanceof PrivateMessageEvent)
			onGenericUserMessage(new GenericUserMessageEvent((PrivateMessageEvent)event));
		else if (event instanceof NoticeEvent)
			onGenericUserMessage(new GenericUserMessageEvent((NoticeEvent)event));
	}
	
	if (event instanceof ExtendedJoinEvent)
		onExtendedJoin((ExtendedJoinEvent)event);
	else if (event instanceof AccountNotifyEvent)
		onAccountNotify((AccountNotifyEvent)event);
	else if (event instanceof OutActionEvent)
		onOutAction((OutActionEvent)event);
	else if (event instanceof OutMessageEvent)
		onOutMessage((OutMessageEvent)event);
	else if (event instanceof OutNoticeEvent)
		onOutNotice((OutNoticeEvent)event);
	else if (event instanceof OutPrivateMessageEvent)
		onOutPrivateMessage((OutPrivateMessageEvent)event);
	else if (event instanceof Whois2Event)
		onWhois2((Whois2Event)event);
	
	if (event instanceof NoticeEvent) {
		NoticeEvent e = (NoticeEvent)event;
		if (e.getUser() == null || e.getUser().getServer() == null || e.getUser().getServer().equals("")) {
			onServerNotice(new ServerNoticeEvent(e.getBot(), e.getUserHostmask(), e.getUser(), e.getMessage()));
			return;
		}
	}
	
	super.onEvent(event);
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:41,代码来源:SkylarkListenerAdapter.java

示例3: createFrom

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
public static Line createFrom(DatabaseManager manager, ActionEvent e) {
	return manager.create(Line.class, obj -> {
		fillFromGenericChannelUserEvent(obj, e);
		obj.type = Type.Action;
		obj.content = e.getMessage();
	});
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:8,代码来源:Line.java

示例4: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent<PircBotX> event) throws Exception {
    String formatted = config.getActionFormatString()
            .replace("{user}", jsonEscape(event.getUser().getNick()))
            .replace("{message}", jsonEscape(event.getMessage()));
    ObfuscationHelper.sendMessageFromJson(formatted);
}
 
开发者ID:14mRh4X0r,项目名称:vanilla-irc,代码行数:8,代码来源:ChatHandler.java

示例5: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent event) throws Exception
{
	if(Lists.isIgnored(event.getUser().getNick()))
	{
		Logging.warn("Ignoring user " + event.getUser().getNick());
		return;
	}
	
	LinkManager.handleLink(event.getMessage(), event.getChannel().getName(), event.getUser().getNick());
}
 
开发者ID:bl4ckscor3,项目名称:bl4ckb0t,代码行数:12,代码来源:Listener.java

示例6: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent event) {
    if (PermUtils.getPermLevel(event.getBot(), event.getUser().getNick(), event.getChannel()) > -4 && IRCUtils.getPrefix(event.getBot(), event.getChannelSource()).isEmpty())
        IRCUtils.sendRelayMessage(event.getBot(), event.getChannel(), "* " + IRCUtils.noPing(event.getUser().getNick()) + " " + event.getMessage());
    if (PermUtils.getPermLevel(event.getBot(), event.getUser().getNick(), event.getChannel()) > -3){
        IRCUtils.addVoice(event.getBot(), event.getChannel(), event.getUser());
    }
}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:9,代码来源:ActionListener.java

示例7: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent event) throws Exception {
    class process implements Runnable {
        public void run() {
            TellMessageTrigger(event.getBot(), event.getUser(), event.getChannel(), IRCUtils.getPrefix(event.getBot(), event.getChannelSource()));
        }
    }
    Registry.threadPool.execute(new process());
}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:10,代码来源:TellMsgListener.java

示例8: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent e) {
    if (!Config.linkChannels) return;
    if (e.getUser().getNick().equals(e.getBot().getNick())) return;
    String message = Config.itiAction;
    message = message.replace("{server}", e.getBot().getConfiguration().getServerHostname());
    message = message.replace("{name}", e.getUser().getNick());
    message = message.replace("{channel}", e.getChannel().getName());
    message = message.replace("{message}", e.getMessage());
    plugin.bh.sendMessageToOtherChannels(message, e.getChannel());
}
 
开发者ID:RoyalDev,项目名称:RoyalIRC,代码行数:12,代码来源:IChatRelay.java

示例9: onAction

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

示例10: pat

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Listener
public void pat(final ActionEvent e) {
    if (!e.getMessage().trim().matches("pats " + e.getBot().getNick() + "\\.?")) return;
    final int chance = this.rb.getConfig().getPatChances(e.getUser().getNick());
    if (chance != 100 && chance / 100D <= this.rb.getRandom().nextDouble()) return;
    e.getChannel().send().action(this.getAction(e.getUser()));
}
 
开发者ID:RoyalDev,项目名称:RoyalBot,代码行数:8,代码来源:PatListener.java

示例11: onAction

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

示例12: GenericUserMessageEvent

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
public GenericUserMessageEvent(ActionEvent e) {
	super(e.getBot());
	event = e;
	eMessage = e;
	eChannelUser = e;
}
 
开发者ID:Shockah,项目名称:Skylark,代码行数:7,代码来源:GenericUserMessageEvent.java

示例13: onAction

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

示例14: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent event) throws Exception
{
	if(event.getAction().startsWith("shrugs"))
		Utilities.sendMessage(event.getChannel().getName(), "¯\\_(ツ)_/¯");
}
 
开发者ID:bl4ckscor3,项目名称:bl4ckb0t,代码行数:7,代码来源:Shrugs.java

示例15: onAction

import org.pircbotx.hooks.events.ActionEvent; //导入依赖的package包/类
@Override
public void onAction(ActionEvent event) throws Exception
{
	action(event.getChannel().getName(), event.getUser().getNick(), event.getMessage());
}
 
开发者ID:bl4ckscor3,项目名称:bl4ckb0t,代码行数:6,代码来源:Logging.java


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