diff --git a/kdb-bot/src/bot_data/model/user_joined_voice_channel.py b/kdb-bot/src/bot_data/model/user_joined_voice_channel.py index dda013e6..3b938452 100644 --- a/kdb-bot/src/bot_data/model/user_joined_voice_channel.py +++ b/kdb-bot/src/bot_data/model/user_joined_voice_channel.py @@ -39,7 +39,10 @@ class UserJoinedVoiceChannel(TableABC): @property @ServiceProviderABC.inject def channel_name(self, bot: DiscordBotServiceABC) -> str: - return bot.get_channel(self.channel_id).name + channel = bot.get_channel(self.channel_id) + if channel is None: + return "" + return channel.name @property def user(self) -> User: diff --git a/kdb-bot/src/bot_data/model/user_joined_voice_channel_history.py b/kdb-bot/src/bot_data/model/user_joined_voice_channel_history.py index 5c1ee49a..0f84b35f 100644 --- a/kdb-bot/src/bot_data/model/user_joined_voice_channel_history.py +++ b/kdb-bot/src/bot_data/model/user_joined_voice_channel_history.py @@ -41,7 +41,10 @@ class UserJoinedVoiceChannelHistory(HistoryTableABC): @property @ServiceProviderABC.inject def channel_name(self, bot: DiscordBotServiceABC) -> str: - return bot.get_channel(self.channel_id).name + channel = bot.get_channel(self.channel_id) + if channel is None: + return "" + return channel.name @property def user(self) -> int: