mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +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]
|
channel = matching_channels[0]
|
||||||
else:
|
else:
|
||||||
author: discord.Member = message.author
|
author: discord.Member = message.author
|
||||||
|
try:
|
||||||
voice: typing.Optional[discord.VoiceState] = author.voice
|
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:
|
if voice is None:
|
||||||
await data.reply("⚠️ Non sei connesso a nessun canale vocale!")
|
await data.reply("⚠️ Non sei connesso a nessun canale vocale!")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue