• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ActionEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onAction

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


示例17: onAction

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


示例18: onAction

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContainerExitEvent类代码示例发布时间:2022-05-22
下一篇:
Java IScoreObjectiveCriteria类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap