Fix channel.send in Discord (#58756)

This commit is contained in:
Michael 2021-10-31 13:32:49 +01:00 committed by GitHub
parent 968e582468
commit 81845bb0b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,9 +94,9 @@ class DiscordNotificationService(BaseNotificationService):
for channelid in kwargs[ATTR_TARGET]:
channelid = int(channelid)
try:
channel = discord_bot.fetch_channel(
channel = await discord_bot.fetch_channel(
channelid
) or discord_bot.fetch_user(channelid)
) or await discord_bot.fetch_user(channelid)
except discord.NotFound:
_LOGGER.warning("Channel not found for ID: %s", channelid)
continue