Better logging message

* Minor change in init message
This commit is contained in:
BreadTube 2026-05-27 16:53:10 +09:00
commit b509a97a8a

View file

@ -33,8 +33,8 @@ class BotCommand(StrEnum):
class Bot:
DEFAULT_MESSAGE_LIST_LIMIT: int = 50
INIT_MESSAGE: str = (
'Bot initialized.\nThis is the current configuration used.\n'
'You can upload a new one to update the configuration.\n'
'Bot initialized.\n'
'You can upload new `config.txt` or `subscriptions.csv` to update them.\n'
f"Available commands: {', '.join(['`' + c.value + '`' for c in BotCommand if c != BotCommand.UNKNOWN])}")
MAX_DOWNLOAD_SIZE: int = 50_000
YT_CHANNEL_NAME_URL = 'https://www.youtube.com/@'
@ -575,12 +575,15 @@ class Bot:
try:
self._refresh_sub(yt_connection, sub_info, channel_dict, category_ranges)
except RuntimeError as error:
self.logger.error('Refreshing subscription %s failed: %s', sub_info.channel_id, error)
self.logger.error('Refreshing subscription %s (%s) failed: %s', sub_info.name, sub_info.channel_id,
error)
except TimeoutError as error:
self.logger.error('Timeout error refreshing subcription: %s', error)
self.logger.error(
'Timeout error refreshing subcription %s (%s): %s', sub_info.name, sub_info.channel_id, error)
break
except Exception as error:
self.logger.error('Refreshing subscription %s unexpectedly failed: %s', sub_info.channel_id, error)
self.logger.error('Refreshing subscription %s (%s) unexpectedly failed: %s', sub_info.name,
sub_info.channel_id, error)
break
yt_connection.close()
self.logger.info('Subs refreshed')