Skip to content

Commit

Permalink
Remove spaces from section names, because they break config command.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsTheFae committed Dec 21, 2024
1 parent 673d032 commit 12cfd70
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions config/example_options.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 = !
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
112 changes: 56 additions & 56 deletions musicbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -365,15 +365,15 @@ 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,
getter="getboolean",
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,
Expand All @@ -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,
Expand All @@ -395,15 +395,15 @@ 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,
getter="getboolean",
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,
Expand All @@ -415,15 +415,15 @@ 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,
getter="getboolean",
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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -640,15 +640,15 @@ 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,
getter="getboolean",
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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions musicbot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@
MUSICBOT_CONFIG_SECTIONS_ORDERED: List[str] = [
"Credentials",
"Permissions",
"Chat Commands",
"Chat Responses",
"ChatCommands",
"ChatResponses",
"Playback",
"Auto Playlist",
"AutoPlaylist",
"MusicBot",
"Files",
]
Expand Down

0 comments on commit 12cfd70

Please sign in to comment.