private void HandleInvite(object sender, InviteChannelInfo inviteInfo) { if (Enabled && !Bot.ServerConfig.NickBlacklist.Contains(inviteInfo.Requester.Nickname) && !NickBlacklist.Contains(inviteInfo.Requester.Nickname)) { if (!Bot.ServerConfig.ChannelBlacklist.Contains(inviteInfo.Channel) && !ChannelBlacklist.Contains(inviteInfo.Channel)) { // Check to see if it's being spammed if (Bot.SpamCheck(Bot.IRC.Channels.Find(chan => chan.Name == inviteInfo.Channel), inviteInfo.Requester, this, new Command() { Name = string.Format("{0} Commands", Name) })) { Bot.IRC.Command.SendJoin(inviteInfo.Channel); string helpMessage = string.Empty; if (Bot.Modules.Exists(module => module.Commands.Exists(cmd => cmd.Triggers.Contains("help") && cmd.Enabled))) { helpMessage = string.Format(" For more information on what I can do, just type: {0}help", Bot.ServerConfig.CommandPrefix); } Bot.IRC.Command.SendPrivateMessage(inviteInfo.Channel, string.Format("{0} has invited me to this channel. If you would like me to leave, just kick me.{1}", inviteInfo.Requester.Nickname, helpMessage)); } } else { Bot.IRC.Command.SendNotice(inviteInfo.Requester.Nickname, "I am unable to join that channel."); } } }
private void LogChannelInvite(object sender, InviteChannelInfo info) { if (!ChannelBlacklist.Contains(info.Channel) && !NickBlacklist.Contains(info.Requester.Nickname)) { AddChannel(info.Channel); AddNick(info.Requester); AddNick(info.Recipient); string query = "INSERT INTO `channelinvites` SET " + "`server_id` = (SELECT `id` FROM `servers` WHERE `name` = {0}), " + "`channel_id` = (SELECT `channels`.`id` FROM `channels` INNER JOIN `servers` ON `servers`.`id` = `channels`.`server_id` WHERE `servers`.`name` = {1} && `channels`.`name` = {2}), " + "`requester_id` = (SELECT `nicks`.`id` FROM `nicks` INNER JOIN `servers` ON `servers`.`id` = `nicks`.`server_id` WHERE `servers`.`name` = {3} && `nicks`.`nickname` = {4}), " + "`recipient_id` = (SELECT `nicks`.`id` FROM `nicks` INNER JOIN `servers` ON `servers`.`id` = `nicks`.`server_id` WHERE `servers`.`name` = {5} && `nicks`.`nickname` = {6}), " + "`date_invited` = {7}"; Bot.Database.Execute(query, new object[] { Bot.ServerConfig.Name, Bot.ServerConfig.Name, info.Channel, Bot.ServerConfig.Name, info.Requester.Nickname, Bot.ServerConfig.Name, info.Recipient.Nickname, info.TimeStamp }); } LogToFile(info.Channel, info.TimeStamp, string.Format("{0} has invited {1} to the channel.", info.Requester.Nickname, info.Recipient.Nickname)); }
private void ChannelInviteHandler(object sender, InviteChannelInfo e) { string message = string.Format("inviting \u0002{0}\u0002 into \u0002{0}\u0002", e.Recipient.Nickname, e.Channel); UpdateSeen(e.Channel, e.Requester, message, e.TimeStamp); }
private void InviteEventHandler(object sender, InviteChannelInfo e, string name) { string msg = string.Format(" * {0} invited {1}", e.Requester.Nickname, e.Recipient.Nickname); AddToBuffer(name, e.Channel, string.Format("[{0}] {1}", e.TimeStamp.ToString("HH:mm:ss"), msg)); }
private void RelayChannelInvite(object sender, InviteChannelInfo e) { string msg = string.Format("[{0}] * {1} invited {2}", e.Channel, e.Requester.Nickname, e.Recipient.Nickname); ProcessRelay(e.Channel, RelayType.Invite, msg); }