mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Fix discord component using userid as target (#63972)
This commit is contained in:
parent
a6fe1c24ab
commit
2df3c85ba6
@ -94,9 +94,10 @@ class DiscordNotificationService(BaseNotificationService):
|
|||||||
for channelid in kwargs[ATTR_TARGET]:
|
for channelid in kwargs[ATTR_TARGET]:
|
||||||
channelid = int(channelid)
|
channelid = int(channelid)
|
||||||
try:
|
try:
|
||||||
channel = await discord_bot.fetch_channel(
|
channel = await discord_bot.fetch_channel(channelid)
|
||||||
channelid
|
except discord.NotFound:
|
||||||
) or await discord_bot.fetch_user(channelid)
|
try:
|
||||||
|
channel = await discord_bot.fetch_user(channelid)
|
||||||
except discord.NotFound:
|
except discord.NotFound:
|
||||||
_LOGGER.warning("Channel not found for ID: %s", channelid)
|
_LOGGER.warning("Channel not found for ID: %s", channelid)
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user