From 12cfd70976db440839bab1e4ce0f7380beef8c30 Mon Sep 17 00:00:00 2001 From: Fae Date: Sat, 21 Dec 2024 12:36:25 -0800 Subject: [PATCH] Remove spaces from section names, because they break config command. --- config/example_options.ini | 6 +- configure.py | 2 +- musicbot/config.py | 112 ++++++++++++++++++------------------- musicbot/constants.py | 6 +- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/config/example_options.ini b/config/example_options.ini index c2f471207..1f8896c5e 100644 --- a/config/example_options.ini +++ b/config/example_options.ini @@ -36,7 +36,7 @@ DevIDs = # All bots are ignored by default. BotExceptionIDs = -[Chat Commands] +[ChatCommands] # Command prefix is how all MusicBot commands must be started in Discord messages. # E.g., if you set this to * the play command is trigger by *play ... CommandPrefix = ! @@ -61,7 +61,7 @@ UseAlias = yes # Allow MusicBot to save a per-server command prefix, and enables the setprefix command. EnablePrefixPerGuild = no -[Chat Responses] +[ChatResponses] # MusicBot will try to send Now Playing notices directly to the member who requested the song instead of posting in a server channel. DMNowPlaying = no @@ -173,7 +173,7 @@ UseOpusAudio = no # This option will disable speed, volume, and UseExperimentalEqualization options. UseOpusProbe = no -[Auto Playlist] +[AutoPlaylist] # Enable MusicBot to automatically play music from the auto playlist when the queue is empty. UseAutoPlaylist = yes diff --git a/configure.py b/configure.py index f047b5a78..28fbca4a4 100644 --- a/configure.py +++ b/configure.py @@ -15,7 +15,7 @@ import subprocess try: - print("You need to install the window-curses pip package.") + print("You need to install the windows-curses pip package.") print("Please wait while we try automatically...\n") subprocess.check_call( [sys.executable, "-m", "pip", "install", "-U", "windows-curses"], diff --git a/musicbot/config.py b/musicbot/config.py index e29a4aaf6..906fb3d17 100644 --- a/musicbot/config.py +++ b/musicbot/config.py @@ -231,7 +231,7 @@ def __init__(self, config_file: pathlib.Path) -> None: # Chat Commands ######################################################################## self.command_prefix: str = self.register.init_option( - section="Chat Commands", + section="ChatCommands", option="CommandPrefix", dest="command_prefix", default=ConfigDefaults.command_prefix, @@ -241,7 +241,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.commands_via_mention: bool = self.register.init_option( - section="Chat Commands", + section="ChatCommands", option="CommandsByMention", dest="commands_via_mention", default=ConfigDefaults.commands_via_mention, @@ -253,7 +253,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.bound_channels: Set[int] = self.register.init_option( - section="Chat Commands", + section="ChatCommands", option="BindToChannels", dest="bound_channels", default=ConfigDefaults.bound_channels, @@ -266,7 +266,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.unbound_servers: bool = self.register.init_option( - section="Chat Commands", + section="ChatCommands", option="AllowUnboundServers", dest="unbound_servers", default=ConfigDefaults.unbound_servers, @@ -278,7 +278,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.usealias: bool = self.register.init_option( - section="Chat Commands", + section="ChatCommands", option="UseAlias", dest="usealias", default=ConfigDefaults.usealias, @@ -289,7 +289,7 @@ def __init__(self, config_file: pathlib.Path) -> None: comment_args={"filepath": DEFAULT_COMMAND_ALIAS_FILE}, ) self.enable_options_per_guild: bool = self.register.init_option( - section="Chat Commands", + section="ChatCommands", option="EnablePrefixPerGuild", dest="enable_options_per_guild", default=ConfigDefaults.enable_options_per_guild, @@ -304,7 +304,7 @@ def __init__(self, config_file: pathlib.Path) -> None: # Chat Responses ######################################################################## self.dm_nowplaying: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DMNowPlaying", dest="dm_nowplaying", default=ConfigDefaults.dm_nowplaying, @@ -314,7 +314,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.no_nowplaying_auto: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DisableNowPlayingAutomatic", dest="no_nowplaying_auto", default=ConfigDefaults.no_nowplaying_auto, @@ -324,7 +324,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.nowplaying_channels: Set[int] = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="NowPlayingChannels", dest="nowplaying_channels", default=ConfigDefaults.nowplaying_channels, @@ -335,7 +335,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.delete_nowplaying: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DeleteNowPlaying", dest="delete_nowplaying", default=ConfigDefaults.delete_nowplaying, @@ -344,7 +344,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ) self.now_playing_mentions: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="NowPlayingMentions", dest="now_playing_mentions", default=ConfigDefaults.now_playing_mentions, @@ -353,7 +353,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ) self.delete_messages: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DeleteMessages", dest="delete_messages", default=ConfigDefaults.delete_messages, @@ -365,7 +365,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.delete_invoking: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DeleteInvoking", dest="delete_invoking", default=ConfigDefaults.delete_invoking, @@ -373,7 +373,7 @@ def __init__(self, config_file: pathlib.Path) -> None: comment=_Dd("Auto delete valid commands after a delay."), ) self.delete_delay_short: float = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DeleteDelayShort", dest="delete_delay_short", default=ConfigDefaults.delete_delay_short, @@ -384,7 +384,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.delete_delay_long: float = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DeleteDelayLong", dest="delete_delay_long", default=ConfigDefaults.delete_delay_long, @@ -395,7 +395,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.embeds: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="UseEmbeds", dest="embeds", default=ConfigDefaults.embeds, @@ -403,7 +403,7 @@ def __init__(self, config_file: pathlib.Path) -> None: comment=_Dd("Allow MusicBot to format its messages as embeds."), ) self.footer_text: str = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="CustomEmbedFooter", dest="footer_text", default=ConfigDefaults.footer_text, @@ -415,7 +415,7 @@ def __init__(self, config_file: pathlib.Path) -> None: default_is_empty=True, ) self.remove_embed_footer: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="RemoveEmbedFooter", dest="remove_embed_footer", default=ConfigDefaults.remove_embed_footer, @@ -423,7 +423,7 @@ def __init__(self, config_file: pathlib.Path) -> None: comment=_Dd("Completely remove the footer from embeds."), ) self.searchlist: bool = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="SearchList", dest="searchlist", default=ConfigDefaults.searchlist, @@ -433,7 +433,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.defaultsearchresults: int = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="DefaultSearchResults", dest="defaultsearchresults", default=ConfigDefaults.defaultsearchresults, @@ -443,7 +443,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.queue_length: int = self.register.init_option( - section="Chat Responses", + section="ChatResponses", option="QueueLength", dest="queue_length", default=ConfigDefaults.queue_length, @@ -630,7 +630,7 @@ def __init__(self, config_file: pathlib.Path) -> None: # Auto Playlist ######################################################################## self.auto_playlist: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="UseAutoPlaylist", dest="auto_playlist", default=ConfigDefaults.auto_playlist, @@ -640,7 +640,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.auto_playlist_random: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="AutoPlaylistRandom", dest="auto_playlist_random", default=ConfigDefaults.auto_playlist_random, @@ -648,7 +648,7 @@ def __init__(self, config_file: pathlib.Path) -> None: comment=_Dd("Shuffles the auto playlist tracks before playing them."), ) self.auto_playlist_autoskip: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="AutoPlaylistAutoSkip", dest="auto_playlist_autoskip", default=ConfigDefaults.auto_playlist_autoskip, @@ -659,7 +659,7 @@ def __init__(self, config_file: pathlib.Path) -> None: ), ) self.auto_playlist_remove_on_block: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="AutoPlaylistRemoveBlocked", dest="auto_playlist_remove_on_block", default=ConfigDefaults.auto_playlist_remove_on_block, @@ -671,7 +671,7 @@ def __init__(self, config_file: pathlib.Path) -> None: # write_path not needed, used for display only. hist_file = pathlib.Path(DEFAULT_PLAYLIST_DIR).joinpath(APL_FILE_HISTORY) self.enable_queue_history_global: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="SavePlayedHistoryGlobal", dest="enable_queue_history_global", default=ConfigDefaults.enable_queue_history_global, @@ -683,7 +683,7 @@ def __init__(self, config_file: pathlib.Path) -> None: comment_args={"filename": hist_file}, ) self.enable_queue_history_guilds: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="SavePlayedHistoryGuilds", dest="enable_queue_history_guilds", default=ConfigDefaults.enable_queue_history_guilds, @@ -698,7 +698,7 @@ def __init__(self, config_file: pathlib.Path) -> None: }, ) self.remove_ap: bool = self.register.init_option( - section="Auto Playlist", + section="AutoPlaylist", option="RemoveFromAPOnError", dest="remove_ap", default=ConfigDefaults.remove_ap, @@ -2504,29 +2504,29 @@ def __init__(self, config_file: pathlib.Path) -> None: # fmt: off # Update #1: Organize old config options into new sections. # Chat Commands - ("Chat", "CommandPrefix", "Chat Commands", "CommandPrefix"), # noqa: E241 - ("Chat", "CommandsByMention", "Chat Commands", "CommandsByMention"), # noqa: E241 - ("Chat", "BindToChannels", "Chat Commands", "BindToChannels"), # noqa: E241 - ("Chat", "AllowUnboundServers", "Chat Commands", "AllowUnboundServers"), # noqa: E241 - ("MusicBot", "EnablePrefixPerGuild", "Chat Commands", "EnablePrefixPerGuild"), # noqa: E241 - ("MusicBot", "UseAlias", "Chat Commands", "UseAlias"), # noqa: E241 + ("Chat", "CommandPrefix", "ChatCommands", "CommandPrefix"), # noqa: E241 + ("Chat", "CommandsByMention", "ChatCommands", "CommandsByMention"), # noqa: E241 + ("Chat", "BindToChannels", "ChatCommands", "BindToChannels"), # noqa: E241 + ("Chat", "AllowUnboundServers", "ChatCommands", "AllowUnboundServers"), # noqa: E241 + ("MusicBot", "EnablePrefixPerGuild", "ChatCommands", "EnablePrefixPerGuild"), # noqa: E241 + ("MusicBot", "UseAlias", "ChatCommands", "UseAlias"), # noqa: E241 # Chat Responses - ("Chat", "DMNowPlaying", "Chat Responses", "DMNowPlaying"), # noqa: E241 - ("Chat", "DisableNowPlayingAutomatic", "Chat Responses", "DisableNowPlayingAutomatic"), # noqa: E241 - ("Chat", "NowPlayingChannels", "Chat Responses", "NowPlayingChannels"), # noqa: E241 - ("Chat", "DeleteNowPlaying", "Chat Responses", "DeleteNowPlaying"), # noqa: E241 - ("MusicBot", "NowPlayingMentions", "Chat Responses", "NowPlayingMentions"), # noqa: E241 - ("MusicBot", "DeleteMessages", "Chat Responses", "DeleteMessages"), # noqa: E241 - ("MusicBot", "DeleteInvoking", "Chat Responses", "DeleteInvoking"), # noqa: E241 - ("MusicBot", "DeleteDelayShort", "Chat Responses", "DeleteDelayShort"), # noqa: E241 - ("MusicBot", "DeleteDelayLong", "Chat Responses", "DeleteDelayLong"), # noqa: E241 - ("MusicBot", "UseEmbeds", "Chat Responses", "UseEmbeds"), # noqa: E241 - ("MusicBot", "QueueLength", "Chat Responses", "QueueLength"), # noqa: E241 - ("MusicBot", "CustomEmbedFooter", "Chat Responses", "CustomEmbedFooter"), # noqa: E241 - ("MusicBot", "RemoveEmbedFooter", "Chat Responses", "RemoveEmbedFooter"), # noqa: E241 - ("MusicBot", "SearchList", "Chat Responses", "SearchList"), # noqa: E241 - ("MusicBot", "DefaultSearchResults", "Chat Responses", "DefaultSearchResults"), # noqa: E241 + ("Chat", "DMNowPlaying", "ChatResponses", "DMNowPlaying"), # noqa: E241 + ("Chat", "DisableNowPlayingAutomatic", "ChatResponses", "DisableNowPlayingAutomatic"), # noqa: E241 + ("Chat", "NowPlayingChannels", "ChatResponses", "NowPlayingChannels"), # noqa: E241 + ("Chat", "DeleteNowPlaying", "ChatResponses", "DeleteNowPlaying"), # noqa: E241 + ("MusicBot", "NowPlayingMentions", "ChatResponses", "NowPlayingMentions"), # noqa: E241 + ("MusicBot", "DeleteMessages", "ChatResponses", "DeleteMessages"), # noqa: E241 + ("MusicBot", "DeleteInvoking", "ChatResponses", "DeleteInvoking"), # noqa: E241 + ("MusicBot", "DeleteDelayShort", "ChatResponses", "DeleteDelayShort"), # noqa: E241 + ("MusicBot", "DeleteDelayLong", "ChatResponses", "DeleteDelayLong"), # noqa: E241 + ("MusicBot", "UseEmbeds", "ChatResponses", "UseEmbeds"), # noqa: E241 + ("MusicBot", "QueueLength", "ChatResponses", "QueueLength"), # noqa: E241 + ("MusicBot", "CustomEmbedFooter", "ChatResponses", "CustomEmbedFooter"), # noqa: E241 + ("MusicBot", "RemoveEmbedFooter", "ChatResponses", "RemoveEmbedFooter"), # noqa: E241 + ("MusicBot", "SearchList", "ChatResponses", "SearchList"), # noqa: E241 + ("MusicBot", "DefaultSearchResults", "ChatResponses", "DefaultSearchResults"), # noqa: E241 # Playback ("MusicBot", "AutoPause", "Playback", "AutoPause"), # noqa: E241 @@ -2546,13 +2546,13 @@ def __init__(self, config_file: pathlib.Path) -> None: ("MusicBot", "UseOpusProbe", "Playback", "UseOpusProbe"), # noqa: E241 # Auto Playlist - ("MusicBot", "UseAutoPlaylist", "Auto Playlist", "UseAutoPlaylist"), # noqa: E241 - ("MusicBot", "AutoPlaylistRandom", "Auto Playlist", "AutoPlaylistRandom"), # noqa: E241 - ("MusicBot", "AutoPlaylistAutoSkip", "Auto Playlist", "AutoPlaylistAutoSkip"), # noqa: E241 - ("MusicBot", "AutoPlaylistRemoveBlocked", "Auto Playlist", "AutoPlaylistRemoveBlocked"), # noqa: E241 - ("MusicBot", "RemoveFromAPOnError", "Auto Playlist", "RemoveFromAPOnError"), # noqa: E241 - ("MusicBot", "SavePlayedHistoryGlobal", "Auto Playlist", "SavePlayedHistoryGlobal"), # noqa: E241 - ("MusicBot", "SavePlayedHistoryGuilds", "Auto Playlist", "SavePlayedHistoryGuilds"), # noqa: E241 + ("MusicBot", "UseAutoPlaylist", "AutoPlaylist", "UseAutoPlaylist"), # noqa: E241 + ("MusicBot", "AutoPlaylistRandom", "AutoPlaylist", "AutoPlaylistRandom"), # noqa: E241 + ("MusicBot", "AutoPlaylistAutoSkip", "AutoPlaylist", "AutoPlaylistAutoSkip"), # noqa: E241 + ("MusicBot", "AutoPlaylistRemoveBlocked", "AutoPlaylist", "AutoPlaylistRemoveBlocked"), # noqa: E241 + ("MusicBot", "RemoveFromAPOnError", "AutoPlaylist", "RemoveFromAPOnError"), # noqa: E241 + ("MusicBot", "SavePlayedHistoryGlobal", "AutoPlaylist", "SavePlayedHistoryGlobal"), # noqa: E241 + ("MusicBot", "SavePlayedHistoryGuilds", "AutoPlaylist", "SavePlayedHistoryGuilds"), # noqa: E241 # MusicBot ("Chat", "AutojoinChannels", "MusicBot", "AutojoinChannels"), diff --git a/musicbot/constants.py b/musicbot/constants.py index 87567d7cb..12a6c5c56 100644 --- a/musicbot/constants.py +++ b/musicbot/constants.py @@ -156,10 +156,10 @@ MUSICBOT_CONFIG_SECTIONS_ORDERED: List[str] = [ "Credentials", "Permissions", - "Chat Commands", - "Chat Responses", + "ChatCommands", + "ChatResponses", "Playback", - "Auto Playlist", + "AutoPlaylist", "MusicBot", "Files", ]