1
mirror of https://github.com/home-assistant/core synced 2024-08-31 05:57:13 +02:00

Discord - Minor bugfixes (#18385)

Suppress PyNaCl warnings of Discord notify
This commit is contained in:
Adam Belebczuk 2018-11-11 17:16:23 -05:00 committed by Fabian Affolter
parent 1f476936a2
commit ca86755409

View File

@ -41,6 +41,8 @@ class DiscordNotificationService(BaseNotificationService):
async def async_send_message(self, message, **kwargs):
"""Login to Discord, send message to channel(s) and log out."""
import discord
discord.VoiceClient.warn_nacl = False
discord_bot = discord.Client(loop=self.hass.loop)
if ATTR_TARGET not in kwargs:
@ -53,6 +55,7 @@ class DiscordNotificationService(BaseNotificationService):
"""Send the messages when the bot is ready."""
try:
data = kwargs.get(ATTR_DATA)
images = None
if data:
images = data.get(ATTR_IMAGES)
for channelid in kwargs[ATTR_TARGET]: