Splamy / TS3AudioBot

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

Global settings [bot.commands.alias] not working #744

Closed ChronoBrake closed 2 years ago

ChronoBrake commented 4 years ago

Hey Sir. I have a problem with new created bots.

This is my fragment ts3audiobot.toml:

[bot.commands]
#Defines how the bot tries to match your !commands. Possible types:
# - exact : Only when the command matches exactly.
# - substring : The shortest command starting with the given prefix.
# - ic3 : 'interleaved continuous character chain' A fuzzy algorithm similar to hamming distance but preferring characters at the start.
matcher = "ic3"
#Defines how the bot handles messages which are too long for a single ts3 message. Options are:
# - split : The message will be split up into multiple messages.
# - drop : Does not send the message.
long_message = "Split"
#Limits the split count for long messages. When for example set to 1 the message will simply be trimmed to one message.
long_message_split_limit = 1
#Enables colors and text highlights for respones.
color = true
#Limits the maximum command complexity to prevent endless loops.
command_complexity = 64

[bot.commands.alias]
yts = "!search from youtube (!param 0)"

[bot.connect]
#The server password. Leave empty for none.
server_password = { pw = "", hashed = false, autohash = false }
#The default channel password. Leave empty for none.
channel_password = { pw = "", hashed = false, autohash = false }
#Overrides the displayed version for the ts3 client. Leave empty for default.
client_version = { build = "", platform = "", sign = "" }
#The address, ip or nickname (and port; default: 9987) of the TeamSpeak3 server
address = "EXAMPLE"
#Default channel when connecting. Use a channel path or "/<id>".
#Examples: "Home/Lobby", "/5", "Home/Afk \\/ Not Here".
channel = ""
#The client badges. You can set a comma seperated string with max three GUID's. Here is a list: http://yat.qa/ressourcen/abzeichen-badges/
badges = ""
#Client nickname when connecting.
name = "TEST"

Bots created by command "!settings create name" and run by "!bot connect template name". New bot have good global name "TEST" and server address "EXAMPLE" in new bot config, but global commands alias seems like not be copied to new bots. Why? Whats wrong? Regards.

ChronoBrake commented 4 years ago

I mean new per bot config looks like:

[commands]

[commands.alias]

...

Alias be copied, but blank. Why?

Splamy commented 4 years ago

The master-derive relation between the ts3audiobot.toml and bot.toml config files does not copy the values from the ts3audiobot .toml when creating. Instead the ts3audiobot.toml values will be taken when a value in a bot.toml file doesn't exist. This makes default values effectively independent from when single bot configs have been created and you can always change them, and the change will be applied globally.

Unfortunetaly for the alias table currently this 'derive' technic isn't implemented so the ts3audiobot.toml values will simply be ignored. The reason is that this isn't that easy to implement. Changing a global alias will need to reload all currently active bots. I'll keep this issue labeld as an enhancemend open and see what I can do.

KredensKuchenny commented 4 years ago

@Splamy in dev version when I add aliases in one of the bot.toml config only this bot which has aliases see this aliases but when I repeat this in master version all bots see aliases. Why?

Splamy commented 4 years ago

This was more or less a side effect of how the command tree worked internally. See https://github.com/Splamy/TS3AudioBot/issues/672#issuecomment-550354370 / https://github.com/Splamy/TS3AudioBot/issues/670#issuecomment-550360657 for why we changed that.

Qmis commented 4 years ago

it is known when it will be corrected @Splamy

Splamy commented 4 years ago

As always then when I get to. You can upvote the first post then it will bubble up when sorting by '👍 '

Qmis commented 4 years ago

anything known finally?

Splamy commented 4 years ago

I have 3 exams and a project submissision by the end of the month, so I'm sorry but there won't be much progess until then.

Flakebi commented 2 years ago

I’m happy to announce that the develop branch gained support for global aliases.

The way they work is that when a bot is started, the global list of aliases is applied to the bot. Adding a global alias will only apply to newly started bots, already running bots will not be updated (this would be very complicated to implement and this is the reason why global aliases were not implemented so far).