Replace channel name spaces to hyphens

This commit is contained in:
BreadTube 2026-05-25 00:26:25 +09:00
commit 4133bca460
4 changed files with 15 additions and 1 deletions

View file

@ -365,6 +365,7 @@ class Bot:
break
if selected_category is None:
selected_category = category_ranges[-1][2]
self.logger.debug('Creating new channel: %s for id %s', subscription.name, subscription.channel_id)
sub_channel = self.discord_manager.create_text_channel(
self.guild_id, {
'name': subscription.name,

View file

@ -68,7 +68,7 @@ class SubscriptionInfo:
@staticmethod
def discord_compatible_name(text: str) -> SubscriptionName:
assert text, 'Channel name cannot be empty'
return SubscriptionName(unidecode(text[:100]))
return SubscriptionName(unidecode(text[:100].replace(' ', '-')))
@staticmethod
def from_dict(info: dict) -> SubscriptionInfo: