mirror of
https://github.com/home-assistant/core
synced 2024-09-12 15:16:21 +02:00
Discord - Minor bugfixes (#18385)
Suppress PyNaCl warnings of Discord notify
This commit is contained in:
parent
1f476936a2
commit
ca86755409
@ -41,6 +41,8 @@ class DiscordNotificationService(BaseNotificationService):
|
|||||||
async def async_send_message(self, message, **kwargs):
|
async def async_send_message(self, message, **kwargs):
|
||||||
"""Login to Discord, send message to channel(s) and log out."""
|
"""Login to Discord, send message to channel(s) and log out."""
|
||||||
import discord
|
import discord
|
||||||
|
|
||||||
|
discord.VoiceClient.warn_nacl = False
|
||||||
discord_bot = discord.Client(loop=self.hass.loop)
|
discord_bot = discord.Client(loop=self.hass.loop)
|
||||||
|
|
||||||
if ATTR_TARGET not in kwargs:
|
if ATTR_TARGET not in kwargs:
|
||||||
@ -53,6 +55,7 @@ class DiscordNotificationService(BaseNotificationService):
|
|||||||
"""Send the messages when the bot is ready."""
|
"""Send the messages when the bot is ready."""
|
||||||
try:
|
try:
|
||||||
data = kwargs.get(ATTR_DATA)
|
data = kwargs.get(ATTR_DATA)
|
||||||
|
images = None
|
||||||
if data:
|
if data:
|
||||||
images = data.get(ATTR_IMAGES)
|
images = data.get(ATTR_IMAGES)
|
||||||
for channelid in kwargs[ATTR_TARGET]:
|
for channelid in kwargs[ATTR_TARGET]:
|
||||||
|
Loading…
Reference in New Issue
Block a user