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.

Nick.cs 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Combot.IRCServices
  7. {
  8. public class Nick
  9. {
  10. public string Username { get; set; }
  11. public string Realname { get; set; }
  12. public string Host { get; set; }
  13. public string Nickname { get; set; }
  14. public string Password { get; set; }
  15. public bool Identified { get; set; }
  16. public bool Registered { get; set; }
  17. public List<UserMode> Modes { get; set; }
  18. public List<PrivilegeMode> Privileges { get; set; }
  19. public Nick()
  20. {
  21. Username = string.Empty;
  22. Realname = string.Empty;
  23. Host = string.Empty;
  24. Nickname = string.Empty;
  25. Password = string.Empty;
  26. Identified = false;
  27. Registered = false;
  28. Modes = new List<UserMode>();
  29. Privileges = new List<PrivilegeMode>();
  30. }
  31. public void AddMode(UserMode mode)
  32. {
  33. if (!Modes.Contains(mode))
  34. {
  35. Modes.Add(mode);
  36. }
  37. }
  38. public void AddModes(List<UserMode> modes)
  39. {
  40. foreach (UserMode mode in modes)
  41. {
  42. AddMode(mode);
  43. }
  44. }
  45. public void RemoveMode(UserMode mode)
  46. {
  47. if (Modes.Contains(mode))
  48. {
  49. Modes.Remove(mode);
  50. }
  51. }
  52. public void RemoveModes(List<UserMode> modes)
  53. {
  54. foreach (UserMode mode in modes)
  55. {
  56. RemoveMode(mode);
  57. }
  58. }
  59. public void AddPrivilege(PrivilegeMode Privilege)
  60. {
  61. if (!Privileges.Contains(Privilege))
  62. {
  63. Privileges.Add(Privilege);
  64. }
  65. }
  66. public void AddPrivileges(List<PrivilegeMode> Privileges)
  67. {
  68. foreach (PrivilegeMode Privilege in Privileges)
  69. {
  70. AddPrivilege(Privilege);
  71. }
  72. }
  73. public void RemovePrivilege(PrivilegeMode Privilege)
  74. {
  75. if (Privileges.Contains(Privilege))
  76. {
  77. Privileges.Remove(Privilege);
  78. }
  79. }
  80. public void RemovePrivileges(List<PrivilegeMode> Privileges)
  81. {
  82. foreach (PrivilegeMode Privilege in Privileges)
  83. {
  84. RemovePrivilege(Privilege);
  85. }
  86. }
  87. }
  88. }