Advertisement
Guest User

Untitled

a guest
Aug 14th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using IrcDotNet;
  7.  
  8. namespace Tim_s_IRC_bot
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. using (var client = new IrcDotNet.StandardIrcClient())
  15.  
  16.  
  17. {
  18. using (var connectedEvent = new ManualResetEventSlim(false))
  19. {
  20. client.Connected += (sender2, e2) => connectedEvent.Set();
  21. client.Connect("irc.freenode.net", 7070, false, new IrcUserRegistrationInfo()
  22. {
  23. NickName = "Tims_Tech",
  24. Password = "****",
  25. UserName = "Tims_Tech"
  26. });
  27.  
  28. if (!connectedEvent.Wait(10000))
  29. {
  30. Console.WriteLine("Connection to '{0}' timed out.", "irc.freenode.net/6667");
  31. Console.ReadLine();
  32. return;
  33.  
  34.  
  35.  
  36.  
  37. }
  38.  
  39. client.Channels.Join("#wrongplanet");
  40.  
  41. Console.ReadLine();
  42.  
  43. };
  44.  
  45.  
  46. };
  47.  
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement