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:
parent
4ceebc2b5f
commit
d907757227
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue