本文整理汇总了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());
}
示例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.");
}
示例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());
}
}
示例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()));
}
}
示例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() + ".");
}
示例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!");
}
示例7: onInvite
import org.pircbotx.hooks.events.InviteEvent; //导入依赖的package包/类
protected void onInvite(InviteEvent e) { }