ttstoy: cleaner accessibility voice list with current-voice marker
This commit is contained in:
+11
-5
@@ -2151,12 +2151,18 @@ class TtsToy(Cog):
|
||||
if voice is None:
|
||||
current = self._access_voice_for(ctx.guild.id, ctx.author.id, engine)
|
||||
current_label = self._access_voice_label(engine, current)
|
||||
listing = ", ".join(f"`{self._access_voice_label(engine, v)}`" for v in pool)
|
||||
lines = []
|
||||
for v in pool:
|
||||
lbl = self._access_voice_label(engine, v)
|
||||
marker = ">" if v == current else " "
|
||||
lines.append(f"{marker} {lbl}")
|
||||
block = "\n".join(lines)
|
||||
return await ctx.send(
|
||||
f"Engine `{engine}`. Your voice: `{current_label}`.\n"
|
||||
f"Available: {listing}\n"
|
||||
f"Set with `{ctx.clean_prefix}ttstoy accessibility voice <name>` "
|
||||
f"(or `auto` to be auto-assigned)."
|
||||
f"**Accessibility voices** (engine: `{engine}`)\n"
|
||||
f"Your voice: `{current_label}` (marked with `>` below)\n"
|
||||
f"```\n{block}\n```\n"
|
||||
f"Set yours: `{ctx.clean_prefix}ttstoy accessibility voice <name>` "
|
||||
f"(or `auto`)"
|
||||
)
|
||||
|
||||
choice = voice.strip()
|
||||
|
||||
Reference in New Issue
Block a user