The easy to use and full featured Irc Bot everyone is talking about!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Invite.cs 1.2KB

123456789101112131415161718192021222324252627282930
  1. using Combot.IRCServices.Messaging;
  2. namespace Combot.Modules.ModuleClasses
  3. {
  4. public class Invite : Module
  5. {
  6. public override void Initialize()
  7. {
  8. Bot.IRC.Message.InviteChannelEvent += HandleInvite;
  9. }
  10. private void HandleInvite(object sender, InviteChannelInfo inviteInfo)
  11. {
  12. if (!Bot.ServerConfig.ChannelBlacklist.Contains(inviteInfo.Channel))
  13. {
  14. Bot.IRC.SendJoin(inviteInfo.Channel);
  15. string helpMessage = string.Empty;
  16. if (Bot.Modules.Exists(module => module.Commands.Exists(cmd => cmd.Triggers.Contains("help") && cmd.Enabled)))
  17. {
  18. helpMessage = string.Format(" For more information on what I can do, just type: {0}help", Bot.ServerConfig.CommandPrefix);
  19. }
  20. Bot.IRC.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));
  21. }
  22. else
  23. {
  24. Bot.IRC.SendNotice(inviteInfo.Requester.Nickname, "I am unable to join that channel.");
  25. }
  26. }
  27. }
  28. }