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.

ServerConfig.cs 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Net;
  6. using System.Threading.Tasks;
  7. using Combot.Modules;
  8. namespace Combot.Configurations
  9. {
  10. public class ServerConfig
  11. {
  12. public event Action ModifyEvent;
  13. public string Name { get; set; }
  14. public string Nickname { get; set; }
  15. public string SecondaryNickname { get; set; }
  16. public string Realname { get; set; }
  17. public string Username { get; set; }
  18. public string Password { get; set; }
  19. public string Email { get; set; }
  20. public List<string> Owners { get; set; }
  21. public List<string> ChannelBlacklist { get; set; }
  22. public List<string> NickBlacklist { get; set; }
  23. public List<HostConfig> Hosts { get; set; }
  24. public List<ChannelConfig> Channels { get; set; }
  25. public List<Module> Modules { get; set; }
  26. public bool AutoConnect { get; set; }
  27. public string CommandPrefix { get; set; }
  28. public int JoinDelay { get; set; }
  29. public ServerConfig()
  30. {
  31. SetDefaults();
  32. }
  33. public void SetDefaults()
  34. {
  35. Name = string.Empty;
  36. AutoConnect = false;
  37. CommandPrefix = string.Empty;
  38. JoinDelay = 0;
  39. Owners = new List<string>();
  40. ChannelBlacklist = new List<string>();
  41. NickBlacklist = new List<string>();
  42. Channels = new List<ChannelConfig>();
  43. Modules = new List<Module>();
  44. Hosts = new List<HostConfig>();
  45. Nickname = string.Empty;
  46. SecondaryNickname = string.Empty;
  47. Realname = string.Empty;
  48. Username = string.Empty;
  49. Password = string.Empty;
  50. Email = string.Empty;
  51. }
  52. public void Save()
  53. {
  54. if (ModifyEvent != null)
  55. {
  56. ModifyEvent();
  57. }
  58. }
  59. }
  60. }