mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Change error messages
This commit is contained in:
parent
9256c3b3c7
commit
32809ab53f
3 changed files with 8 additions and 6 deletions
|
@ -71,7 +71,8 @@ class PlayCommand(Command):
|
||||||
raise CommandError("PlayCommand only accepts URLs.\n"
|
raise CommandError("PlayCommand only accepts URLs.\n"
|
||||||
"If you want to search a song on YouTube or Soundcloud, please use YoutubeCommand"
|
"If you want to search a song on YouTube or Soundcloud, please use YoutubeCommand"
|
||||||
" or SoundcloudCommand!")
|
" or SoundcloudCommand!")
|
||||||
response = await self.interface.net_request(Request("music_play", {"url": url, "guild_name": guild_name}), "discord")
|
response = await self.interface.net_request(Request("music_play", {"url": url, "guild_name": guild_name}),
|
||||||
|
"discord")
|
||||||
if len(response["videos"]) == 0:
|
if len(response["videos"]) == 0:
|
||||||
raise CommandError(f"Nessun file trovato.")
|
raise CommandError(f"Nessun file trovato.")
|
||||||
for video in response["videos"]:
|
for video in response["videos"]:
|
||||||
|
|
|
@ -10,6 +10,7 @@ from ...utils import NetworkHandler, asyncify
|
||||||
from ...network import Request, ResponseSuccess
|
from ...network import Request, ResponseSuccess
|
||||||
from ..commanderrors import CommandError
|
from ..commanderrors import CommandError
|
||||||
from ...audio import YtdlDiscord
|
from ...audio import YtdlDiscord
|
||||||
|
|
||||||
if typing.TYPE_CHECKING:
|
if typing.TYPE_CHECKING:
|
||||||
from ...bots import DiscordBot
|
from ...bots import DiscordBot
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ class SoundcloudCommand(Command):
|
||||||
"guild_name": guild_name}),
|
"guild_name": guild_name}),
|
||||||
"discord")
|
"discord")
|
||||||
if len(response["videos"]) == 0:
|
if len(response["videos"]) == 0:
|
||||||
raise CommandError(f"Nessun audio trovato.")
|
raise CommandError(f"Il video non può essere scaricato a causa di un blocco imposto da Soundcloud.")
|
||||||
for video in response["videos"]:
|
for video in response["videos"]:
|
||||||
if self.interface.name == "discord":
|
if self.interface.name == "discord":
|
||||||
# This is one of the unsafest things ever
|
# This is one of the unsafest things ever
|
||||||
|
|
|
@ -73,7 +73,7 @@ class YoutubeCommand(Command):
|
||||||
"guild_name": guild_name}),
|
"guild_name": guild_name}),
|
||||||
"discord")
|
"discord")
|
||||||
if len(response["videos"]) == 0:
|
if len(response["videos"]) == 0:
|
||||||
raise CommandError(f"Il bot non è riuscito a scaricare il video richiesto a causa di un blocco imposto da YouTube.")
|
raise CommandError(f"Il video non può essere scaricato a causa di un blocco imposto da YouTube.")
|
||||||
for video in response["videos"]:
|
for video in response["videos"]:
|
||||||
if self.interface.name == "discord":
|
if self.interface.name == "discord":
|
||||||
# This is one of the unsafest things ever
|
# This is one of the unsafest things ever
|
||||||
|
|
Loading…
Reference in a new issue