1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00

Don't crash if the bot is summoned in a private chat

This commit is contained in:
Steffo 2019-09-10 13:45:19 +02:00
parent 4ceebc2b5f
commit d907757227

View file

@ -61,7 +61,11 @@ class SummonCommand(Command):
channel = matching_channels[0]
else:
author: discord.Member = message.author
voice: typing.Optional[discord.VoiceState] = author.voice
try:
voice: typing.Optional[discord.VoiceState] = author.voice
except AttributeError:
await data.reply("⚠️ Non puoi evocare il bot da una chat privata!")
return
if voice is None:
await data.reply("⚠️ Non sei connesso a nessun canale vocale!")
return