Compare commits

..

No commits in common. "dd2177bd1292d66904d7a5a28f84dff598a34b0e" and "96acbc127b6cc327bdc9dababa8a2fd6ccf3b3bd" have entirely different histories.

16
main.py
View File

@ -492,6 +492,8 @@ 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,
@ -557,7 +559,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 """!restart: Restart the bot (admin only)
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.
@ -579,7 +581,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 """!quit: Shutdown the bot (admin only)
Gracefully shuts down the bot and exits without restarting. Gracefully shuts down the bot and exits without restarting.
@ -598,7 +600,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 """!reconnect: Reconnect to the stream (admin only)
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.
@ -614,7 +616,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 """!stop: Stop stream monitoring (admin only)
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.
@ -630,7 +632,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 """!start: Start stream monitoring (admin only)
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.
@ -646,7 +648,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 """!quiet: Disable song announcements (admin only)
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.
@ -663,7 +665,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 """!unquiet: Enable song announcements (admin only)
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.