Compare commits

..

2 Commits

Author SHA1 Message Date
dd2177bd12
dummy commit 2025-02-25 03:23:24 -08:00
d841360031 v1.2.1: Fix redundant admin text in help command output 2025-02-25 03:09:20 -08:00

16
main.py
View File

@ -492,8 +492,6 @@ class IcecastBot:
first_line = handler.__doc__.strip().split('\n')[0] first_line = handler.__doc__.strip().split('\n')[0]
# Format it using the template and add (admin only) if needed # Format it using the template and add (admin only) if needed
desc = first_line.split(':', 1)[1].strip() desc = first_line.split(':', 1)[1].strip()
if pattern in self.admin_commands:
desc = f"{desc} (admin only)"
help_text = self.help_specific_format.format( help_text = self.help_specific_format.format(
prefix=self.cmd_prefix, prefix=self.cmd_prefix,
cmd=pattern, cmd=pattern,
@ -559,7 +557,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('restart')) @self.bot.on_message(create_command_pattern('restart'))
@self.admin_required @self.admin_required
async def restart_bot(message): async def restart_bot(message):
"""!restart: Restart the bot (admin only) """!restart: Restart the bot
Gracefully shuts down the bot and signals the bot.sh script Gracefully shuts down the bot and signals the bot.sh script
to restart it. This ensures a clean restart. to restart it. This ensures a clean restart.
@ -581,7 +579,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('quit')) @self.bot.on_message(create_command_pattern('quit'))
@self.admin_required @self.admin_required
async def quit_bot(message): async def quit_bot(message):
"""!quit: Shutdown the bot (admin only) """!quit: Shutdown the bot
Gracefully shuts down the bot and exits without restarting. Gracefully shuts down the bot and exits without restarting.
@ -600,7 +598,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('reconnect')) @self.bot.on_message(create_command_pattern('reconnect'))
@self.admin_required @self.admin_required
async def reconnect_stream(message): async def reconnect_stream(message):
"""!reconnect: Reconnect to the stream (admin only) """!reconnect: Reconnect to the stream
Attempts to reconnect to the stream and verifies the connection. Attempts to reconnect to the stream and verifies the connection.
Reports success or failure back to the channel. Reports success or failure back to the channel.
@ -616,7 +614,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('stop')) @self.bot.on_message(create_command_pattern('stop'))
@self.admin_required @self.admin_required
async def stop_monitoring(message): async def stop_monitoring(message):
"""!stop: Stop stream monitoring (admin only) """!stop: Stop stream monitoring
Stops monitoring the stream for metadata changes. Stops monitoring the stream for metadata changes.
The bot remains connected to IRC. The bot remains connected to IRC.
@ -632,7 +630,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('start')) @self.bot.on_message(create_command_pattern('start'))
@self.admin_required @self.admin_required
async def start_monitoring(message): async def start_monitoring(message):
"""!start: Start stream monitoring (admin only) """!start: Start stream monitoring
Starts monitoring the stream for metadata changes. Starts monitoring the stream for metadata changes.
Will announce new songs in the channel. Will announce new songs in the channel.
@ -648,7 +646,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('quiet')) @self.bot.on_message(create_command_pattern('quiet'))
@self.admin_required @self.admin_required
async def quiet_bot(message): async def quiet_bot(message):
"""!quiet: Disable song announcements (admin only) """!quiet: Disable song announcements
Continues monitoring the stream for metadata changes, Continues monitoring the stream for metadata changes,
but stops announcing songs in the channel. but stops announcing songs in the channel.
@ -665,7 +663,7 @@ class IcecastBot:
@self.bot.on_message(create_command_pattern('unquiet')) @self.bot.on_message(create_command_pattern('unquiet'))
@self.admin_required @self.admin_required
async def unquiet_bot(message): async def unquiet_bot(message):
"""!unquiet: Enable song announcements (admin only) """!unquiet: Enable song announcements
Resumes announcing songs in the channel. Resumes announcing songs in the channel.
The bot must already be monitoring the stream. The bot must already be monitoring the stream.