Advertisement
Guest User

Untitled

a guest
Mar 18th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using TS3QueryLib.Core;
  7. using TS3QueryLib.Core.Server;
  8. using TS3QueryLib.Core.Server.Responses;
  9.  
  10. namespace TS3Music
  11. {
  12. class Program
  13. {
  14. public static QueryRunner QR;
  15.  
  16. public static uint channelID;
  17. public static uint clientID;
  18.  
  19. static void Main(string[] args)
  20. {
  21. string targetHost = "176.31.196.112";
  22. ushort targetPort = 4607;
  23. string username = "serveradmin";
  24. string password = "KR95cyDn";
  25.  
  26. using (QR = new QueryRunner(new SyncTcpDispatcher(targetHost, targetPort)))
  27. {
  28. var loginResponse = QR.Login(username, password);
  29. if(loginResponse.IsErroneous)
  30. {
  31. Console.WriteLine("Unable to login through serverquery.");
  32. Console.WriteLine("Reason: " + loginResponse.ErrorMessage);
  33. }
  34. else
  35. {
  36. initiateCommands();
  37. // welcomeMessage();
  38. }
  39. }
  40. }
  41.  
  42. public static void welcomeMessage()
  43. {
  44. QR.SendGlobalMessage("Jack's Musicbot is now ready to take requests! ♥");
  45. Console.ReadLine();
  46. }
  47.  
  48. public static void initiateCommands()
  49. {
  50. QR.SendRaw("clientupdate client_nickname=Sexy\\sMusicBot");
  51. QR.SendRaw("use 1");
  52. var getMusicBotID = QR.GetClientIdsByUniqueId("WLVpofVCGZ95V+XlLYa+3PPDQ7o=");
  53. clientID = 0;
  54. foreach (var ID in getMusicBotID)
  55. {
  56. clientID = ID.ClientId;
  57. }
  58. var getMusicBotLocation = QR.GetClientInfo(clientID);
  59. channelID = getMusicBotLocation.ChannelId;
  60.  
  61. var register = QR.SendRaw("servernotifyregister event=channel id=" + channelID);
  62. Console.WriteLine(register);
  63.  
  64. }
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement