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

@@ -85,7 +85,7 @@ class MixinMeta(ABC):
_disconnected_shard: Set[int]
@abstractmethod
async def command_llsetup(self, ctx: commands.Context):
async def command_llset(self, ctx: commands.Context):
raise NotImplementedError()
@commands.command()

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:

View File

@@ -75,92 +75,92 @@ HUMANIZED_PERM = {
}
DANGEROUS_COMMANDS = {
"command_llsetup_java": _(
"command_llset_java": _(
"This command will change the executable path of Java, "
"this is useful if you have multiple installations of Java and the default one is causing issues. "
"Please don't change this unless you are certain that the Java version you are specifying is supported by Red. "
"The default and supported version is currently Java 11."
),
"command_llsetup_heapsize": _(
"command_llset_heapsize": _(
"This command will change the maximum RAM allocation for the managed Lavalink node, "
"usually you will never have to change this, "
"before considering changing it please consult our support team."
),
"command_llsetup_external": _(
"command_llset_external": _(
"This command will disable the managed Lavalink node, "
"if you toggle this command you must specify an external Lavalink node to connect to, "
"if you do not do so Audio will stop working."
),
"command_llsetup_host": _(
"command_llset_host": _(
"This command is used to specify the IP which will be used by Red to connect to an external Lavalink node. "
),
"command_llsetup_password": _(
"command_llset_password": _(
"This command is used to specify the authentication password used by Red to connect to an "
"external Lavalink node."
),
"command_llsetup_secured": _(
"command_llset_secured": _(
"This command is used toggle between secured and unsecured connections to an external Lavalink node."
),
"command_llsetup_wsport": _(
"command_llset_wsport": _(
"This command is used to specify the connection port used by Red to connect to an external Lavalink node."
),
"command_llsetup_config_host": _(
"command_llset_config_host": _(
"This command specifies which network interface and IP the managed Lavalink node will bind to, "
"by default this is 'localhost', "
"only change this if you want the managed Lavalink node to bind to a specific IP/interface."
),
"command_llsetup_config_token": _(
"command_llset_config_token": _(
"This command changes the authentication password required to connect to this managed node."
"The default value is 'youshallnotpass'."
),
"command_llsetup_config_port": _(
"command_llset_config_port": _(
"This command changes the connection port used to connect to this managed node, "
"only change this if the default port '2333' is causing conflicts with existing applications."
),
"command_llsetup_config_source_http": _(
"command_llset_config_source_http": _(
"This command toggles the support of direct url streams like Icecast or Shoutcast streams. "
"An example is <http://ice1.somafm.com/gsclassic-128-mp3>; "
"disabling this will make the bot unable to play any direct url steam content."
),
"command_llsetup_config_source_bandcamp": _(
"command_llset_config_source_bandcamp": _(
"This command toggles the support of Bandcamp audio playback. "
"An example is <http://deaddiskdrive.bandcamp.com/track/crystal-glass>; "
"disabling this will make the bot unable to play any Bandcamp content",
),
"command_llsetup_config_source_local": _(
"command_llset_config_source_local": _(
"This command toggles the support of local track audio playback. "
"An example is `/mnt/data/my_super_funky_track.mp3`; "
"disabling this will make the bot unable to play any local track content."
),
"command_llsetup_config_source_soundcloud": _(
"command_llset_config_source_soundcloud": _(
"This command toggles the support of SoundCloud playback. "
"An example is <https://soundcloud.com/user-103858850/tilla>; "
"disabling this will make the bot unable to play any SoundCloud content."
),
"command_llsetup_config_source_youtube": _(
"command_llset_config_source_youtube": _(
"This command toggles the support of YouTube playback (Spotify depends on YouTube). "
"Disabling this will make the bot unable to play any YouTube content: "
"this includes Spotify."
),
"command_llsetup_config_source_twitch": _(
"command_llset_config_source_twitch": _(
"This command toggles the support of Twitch playback. "
"An example of this is <https://twitch.tv/monstercat>; "
"disabling this will make the bot unable to play any Twitch content."
),
"command_llsetup_config_source_vimeo": _(
"command_llset_config_source_vimeo": _(
"This command toggles the support of Vimeo playback. "
"An example of this is <https://vimeo.com/157743578>; "
"disabling this will make the bot unable to play any Vimeo content."
),
"command_llsetup_config_server_framebuffer": _(
"command_llset_config_server_framebuffer": _(
"This setting controls the managed node's framebuffer, "
"do not change this unless instructed."
),
"command_llsetup_config_server_buffer": _(
"command_llset_config_server_buffer": _(
"This setting controls the managed node's JDA-NAS buffer, "
"do not change this unless instructed."
),
"command_llsetup_reset": _("This command will reset every setting changed by `[p]llset`."),
"command_llset_reset": _("This command will reset every setting changed by `[p]llset`."),
}
_ = _T
@@ -172,7 +172,7 @@ class DpyEvents(MixinMeta, metaclass=CompositeMetaClass):
# check for unsupported arch
# Check on this needs refactoring at a later date
# so that we have a better way to handle the tasks
if self.command_llsetup in [ctx.command, ctx.command.root_parent]:
if self.command_llset in [ctx.command, ctx.command.root_parent]:
pass
elif self.lavalink_connect_task and self.lavalink_connect_task.cancelled():