Remove llsetup alias for llset (#5953)

Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
aikaterna
2023-01-14 06:33:03 -08:00
committed by GitHub
parent eda1288bea
commit a13870b45f
5 changed files with 204 additions and 204 deletions

View File

@@ -30,10 +30,10 @@ _ = Translator("Audio", Path(__file__))
class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
@commands.group(name="llsetup", aliases=["llset"])
@commands.group(name="llset")
@commands.is_owner()
@commands.bot_has_permissions(embed_links=True)
async def command_llsetup(self, ctx: commands.Context):
async def command_llset(self, ctx: commands.Context):
"""`Dangerous commands` Manage Lavalink node configuration settings.
This command block holds all commands to manage an unmanaged (external) or managed Lavalink node.
@@ -43,9 +43,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
All the commands in here have the potential to break the Audio cog.
"""
@command_llsetup.command(name="java")
@command_llset.command(name="java")
@has_managed_server()
async def command_llsetup_java(self, ctx: commands.Context, *, java_path: str = "java"):
async def command_llset_java(self, ctx: commands.Context, *, java_path: str = "java"):
"""Change your Java executable path.
This command shouldn't need to be used most of the time, and is only useful if the host machine has conflicting Java versions.
@@ -90,9 +90,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="heapsize", aliases=["hs", "ram", "memory"])
@command_llset.command(name="heapsize", aliases=["hs", "ram", "memory"])
@has_managed_server()
async def command_llsetup_heapsize(self, ctx: commands.Context, size: str = MAX_JAVA_RAM):
async def command_llset_heapsize(self, ctx: commands.Context, size: str = MAX_JAVA_RAM):
"""Set the managed Lavalink node maximum heap-size.
By default, this value is 50% of available RAM in the host machine represented by [1-1024][M|G] (256M, 256G for example)
@@ -152,8 +152,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="external", aliases=["unmanaged"])
async def command_llsetup_external(self, ctx: commands.Context):
@command_llset.command(name="external", aliases=["unmanaged"])
async def command_llset_external(self, ctx: commands.Context):
"""Toggle using external Lavalink nodes - requires an existing external Lavalink node for Audio to work, if enabled.
This command disables the managed Lavalink server, if you do not have an external Lavalink node you will be unable to use Audio while this is enabled.
@@ -189,9 +189,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="host")
@command_llset.command(name="host")
@has_unmanaged_server()
async def command_llsetup_host(
async def command_llset_host(
self, ctx: commands.Context, host: str = DEFAULT_LAVALINK_SETTINGS["host"]
):
"""Set the Lavalink node host.
@@ -210,9 +210,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="password", aliases=["pass", "token"])
@command_llset.command(name="password", aliases=["pass", "token"])
@has_unmanaged_server()
async def command_llsetup_password(
async def command_llset_password(
self, ctx: commands.Context, *, password: str = DEFAULT_LAVALINK_SETTINGS["password"]
):
"""Set the Lavalink node password.
@@ -234,9 +234,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="port")
@command_llset.command(name="port")
@has_unmanaged_server()
async def command_llsetup_wsport(
async def command_llset_wsport(
self, ctx: commands.Context, port: int = DEFAULT_LAVALINK_SETTINGS["ws_port"]
):
"""Set the Lavalink node port.
@@ -263,9 +263,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="secured", aliases=["wss"])
@command_llset.command(name="secured", aliases=["wss"])
@has_unmanaged_server()
async def command_llsetup_secured(self, ctx: commands.Context):
async def command_llset_secured(self, ctx: commands.Context):
"""Set the Lavalink node connection to secured.
This toggle sets the connection type to secured or unsecured when connecting to an external Lavalink node.
@@ -299,8 +299,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
secured_protocol=inline("wss://"),
)
@command_llsetup.command(name="info", aliases=["settings"])
async def command_llsetup_info(self, ctx: commands.Context):
@command_llset.command(name="info", aliases=["settings"])
async def command_llset_info(self, ctx: commands.Context):
"""Display Lavalink connection settings."""
configs = await self.config.all()
@@ -332,9 +332,9 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
except discord.HTTPException:
await ctx.send(_("I need to be able to DM you to send you this info."))
@command_llsetup.command(name="yaml", aliases=["yml"])
@command_llset.command(name="yaml", aliases=["yml"])
@has_managed_server()
async def command_llsetup_yaml(self, ctx: commands.Context):
async def command_llset_yaml(self, ctx: commands.Context):
"""Uploads a copy of the application.yml file used by the managed Lavalink node."""
configs = change_dict_naming_convention(await self.config.yaml.all())
data = yaml.safe_dump(configs)
@@ -356,20 +356,20 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
finally:
temp_file.unlink()
@command_llsetup.group(name="config", aliases=["conf"])
@command_llset.group(name="config", aliases=["conf"])
@has_managed_server()
async def command_llsetup_config(self, ctx: commands.Context):
async def command_llset_config(self, ctx: commands.Context):
"""Configure the managed Lavalink node runtime options.
All settings under this group will likely cause Audio to malfunction if changed from their defaults, only change settings here if you have been advised to by support.
"""
@command_llsetup_config.group(name="server")
async def command_llsetup_config_server(self, ctx: commands.Context):
@command_llset_config.group(name="server")
async def command_llset_config_server(self, ctx: commands.Context):
"""Configure the managed node authorization and connection settings."""
@command_llsetup_config.command(name="bind", aliases=["host", "address"])
async def command_llsetup_config_host(
@command_llset_config.command(name="bind", aliases=["host", "address"])
async def command_llset_config_host(
self, ctx: commands.Context, *, host: str = DEFAULT_LAVALINK_YAML["yaml__server__address"]
):
"""`Dangerous command` Set the managed Lavalink node's binding IP address.
@@ -389,8 +389,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup_config.command(name="token", aliases=["password", "pass"])
async def command_llsetup_config_token(
@command_llset_config.command(name="token", aliases=["password", "pass"])
async def command_llset_config_token(
self,
ctx: commands.Context,
*,
@@ -415,8 +415,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup_config.command(name="port")
async def command_llsetup_config_port(
@command_llset_config.command(name="port")
async def command_llset_config_port(
self, ctx: commands.Context, *, port: int = DEFAULT_LAVALINK_YAML["yaml__server__port"]
):
"""`Dangerous command` Set the managed Lavalink node's connection port.
@@ -446,15 +446,15 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup_config.group(name="source")
async def command_llsetup_config_source(self, ctx: commands.Context):
@command_llset_config.group(name="source")
async def command_llset_config_source(self, ctx: commands.Context):
"""`Dangerous command` Toggle audio sources on/off.
By default, all sources are enabled, you should only use commands here to disable a specific source if you have been advised to, disabling sources without background knowledge can cause Audio to break.
"""
@command_llsetup_config_source.command(name="http")
async def command_llsetup_config_source_http(self, ctx: commands.Context):
@command_llset_config_source.command(name="http")
async def command_llset_config_source_http(self, ctx: commands.Context):
"""Toggle HTTP direct URL usage on or off.
This source is used to allow playback from direct HTTP streams (this does not affect direct URL playback for the other sources).
@@ -480,8 +480,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_source.command(name="bandcamp", aliases=["bc"])
async def command_llsetup_config_source_bandcamp(self, ctx: commands.Context):
@command_llset_config_source.command(name="bandcamp", aliases=["bc"])
async def command_llset_config_source_bandcamp(self, ctx: commands.Context):
"""Toggle Bandcamp source on or off.
This toggle controls the playback of all Bandcamp related content.
@@ -507,8 +507,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_source.command(name="local")
async def command_llsetup_config_source_local(self, ctx: commands.Context):
@command_llset_config_source.command(name="local")
async def command_llset_config_source_local(self, ctx: commands.Context):
"""Toggle local file usage on or off.
This toggle controls the playback of all local track content, usually found inside the `localtracks` folder.
@@ -534,8 +534,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_source.command(name="soundcloud", aliases=["sc"])
async def command_llsetup_config_source_soundcloud(self, ctx: commands.Context):
@command_llset_config_source.command(name="soundcloud", aliases=["sc"])
async def command_llset_config_source_soundcloud(self, ctx: commands.Context):
"""Toggle Soundcloud source on or off.
This toggle controls the playback of all SoundCloud related content.
@@ -561,8 +561,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_source.command(name="youtube", aliases=["yt"])
async def command_llsetup_config_source_youtube(self, ctx: commands.Context):
@command_llset_config_source.command(name="youtube", aliases=["yt"])
async def command_llset_config_source_youtube(self, ctx: commands.Context):
"""`Dangerous command` Toggle YouTube source on or off (this includes Spotify).
This toggle controls the playback of all YouTube and Spotify related content.
@@ -588,8 +588,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_source.command(name="twitch")
async def command_llsetup_config_source_twitch(self, ctx: commands.Context):
@command_llset_config_source.command(name="twitch")
async def command_llset_config_source_twitch(self, ctx: commands.Context):
"""Toggle Twitch source on or off.
This toggle controls the playback of all Twitch related content.
@@ -615,8 +615,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_source.command(name="vimeo")
async def command_llsetup_config_source_vimeo(self, ctx: commands.Context):
@command_llset_config_source.command(name="vimeo")
async def command_llset_config_source_vimeo(self, ctx: commands.Context):
"""Toggle Vimeo source on or off.
This toggle controls the playback of all Vimeo related content.
@@ -642,8 +642,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
).format(p=ctx.prefix, cmd=self.command_audioset_restart.qualified_name),
)
@command_llsetup_config_server.command(name="framebuffer", aliases=["fb", "frame"])
async def command_llsetup_config_server_framebuffer(
@command_llset_config_server.command(name="framebuffer", aliases=["fb", "frame"])
async def command_llset_config_server_framebuffer(
self,
ctx: commands.Context,
*,
@@ -673,8 +673,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup_config_server.command(name="buffer", aliases=["b"])
async def command_llsetup_config_server_buffer(
@command_llset_config_server.command(name="buffer", aliases=["b"])
async def command_llset_config_server_buffer(
self,
ctx: commands.Context,
*,
@@ -704,8 +704,8 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
),
)
@command_llsetup.command(name="reset")
async def command_llsetup_reset(self, ctx: commands.Context):
@command_llset.command(name="reset")
async def command_llset_reset(self, ctx: commands.Context):
"""Reset all `llset` changes back to their default values."""
async with ctx.typing():
async with self.config.all() as global_data: