diff --git a/homeassistant/components/discord/notify.py b/homeassistant/components/discord/notify.py index c3f7de94af0..e8b084a01ab 100644 --- a/homeassistant/components/discord/notify.py +++ b/homeassistant/components/discord/notify.py @@ -94,12 +94,13 @@ class DiscordNotificationService(BaseNotificationService): for channelid in kwargs[ATTR_TARGET]: channelid = int(channelid) try: - channel = await discord_bot.fetch_channel( - channelid - ) or await discord_bot.fetch_user(channelid) + channel = await discord_bot.fetch_channel(channelid) except discord.NotFound: - _LOGGER.warning("Channel not found for ID: %s", channelid) - continue + try: + channel = await discord_bot.fetch_user(channelid) + except discord.NotFound: + _LOGGER.warning("Channel not found for ID: %s", channelid) + continue # Must create new instances of File for each channel. files = [discord.File(image) for image in images] if images else None await channel.send(message, files=files, embed=embed)