Splamy / TS3AudioBot

Advanced Musicbot for Teamspeak 3
https://splamy.de/TSAudioBot/Home
Open Software License 3.0
678 stars 138 forks source link

Connect with Name & Server #360

Open rexlManu opened 6 years ago

rexlManu commented 6 years ago

Eng (googletranslate): I do not know if this feature is already installed. If not, it would be nice if you could also specify the bot name for the API with Connect. ger: Ich weiß nicht ob dieses Feature bereits eingebaut ist. Wenn nicht wäre es schön wenn man bei der API mit Connect auch den Bot Namen festlegen könnte.

dzinks2009 commented 6 years ago

You can always edit command !bot connect. I have it like this:

        [Command("bot connect to")]
        public static BotInfo CommandBotConnectNew(BotManager bots, string address, string name = null, string channel = null)
        {
            var botConf = bots.CreateNewBot();
            botConf.Connect.Address.Value = address;
            if (!string.IsNullOrEmpty(name)) botConf.Connect.Name.Value = name;
            if (!string.IsNullOrEmpty(channel)) botConf.Connect.Channel.Value = channel;
            var botInfo = bots.RunBot(botConf);
            if (!botInfo.Ok)
                throw new CommandException(strings.error_could_not_create_bot + $" ({botInfo.Error})", CommandExceptionReason.CommandError);
            return botInfo.Value; // TODO check value/object
        }

I only use the TS3AudioBot API for most of the commands and this works perfectly fine for me.

Splamy commented 5 years ago

How would you change the api? The current api as you know looks like this: /bot/connect/to/<address:string>/<password:string?> This means a second overload with /bot/connect/to/<address:string>/<nick:string>/<password:string?> will be indistinguishable with the first one, when no password is set. Changing the first to the second would require you to always enter a nickname if you'd want to add a password (or the other way around with the nickname, when you swap nick and password)

Feel free to suggest something or discuss, maybe you can come up with a nice solution.

rexlManu commented 5 years ago

Yes but make option that when the password is "" also empty then it connect with out password.