Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TS3QueryLib.Core;
- using TS3QueryLib.Core.Server;
- using TS3QueryLib.Core.Server.Responses;
- namespace TS3Music
- {
- class Program
- {
- public static QueryRunner QR;
- public static uint channelID;
- public static uint clientID;
- static void Main(string[] args)
- {
- string targetHost = "176.31.196.112";
- ushort targetPort = 4607;
- string username = "serveradmin";
- string password = "KR95cyDn";
- using (QR = new QueryRunner(new SyncTcpDispatcher(targetHost, targetPort)))
- {
- var loginResponse = QR.Login(username, password);
- if(loginResponse.IsErroneous)
- {
- Console.WriteLine("Unable to login through serverquery.");
- Console.WriteLine("Reason: " + loginResponse.ErrorMessage);
- }
- else
- {
- initiateCommands();
- // welcomeMessage();
- }
- }
- }
- public static void welcomeMessage()
- {
- QR.SendGlobalMessage("Jack's Musicbot is now ready to take requests! ♥");
- Console.ReadLine();
- }
- public static void initiateCommands()
- {
- QR.SendRaw("clientupdate client_nickname=Sexy\\sMusicBot");
- QR.SendRaw("use 1");
- var getMusicBotID = QR.GetClientIdsByUniqueId("WLVpofVCGZ95V+XlLYa+3PPDQ7o=");
- clientID = 0;
- foreach (var ID in getMusicBotID)
- {
- clientID = ID.ClientId;
- }
- var getMusicBotLocation = QR.GetClientInfo(clientID);
- channelID = getMusicBotLocation.ChannelId;
- var register = QR.SendRaw("servernotifyregister event=channel id=" + channelID);
- Console.WriteLine(register);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement