audio: rename from youtubedl
This commit is contained in:
@@ -4,9 +4,9 @@ import disnake
|
||||
import disnake_paginator
|
||||
|
||||
import arguments
|
||||
import audio
|
||||
import commands
|
||||
import utils
|
||||
import youtubedl
|
||||
from constants import EMBED_COLOR
|
||||
from state import client, players
|
||||
|
||||
@@ -16,7 +16,7 @@ from .utils import command_allowed, ensure_joined, play_next
|
||||
|
||||
async def queue_or_play(message, edited=False):
|
||||
if message.guild.id not in players:
|
||||
players[message.guild.id] = youtubedl.QueuedPlayer()
|
||||
players[message.guild.id] = audio.QueuedPlayer()
|
||||
|
||||
tokens = commands.tokenize(message.content)
|
||||
parser = arguments.ArgumentParser(
|
||||
@@ -154,7 +154,7 @@ async def queue_or_play(message, edited=False):
|
||||
|
||||
try:
|
||||
async with message.channel.typing():
|
||||
player = await youtubedl.YTDLSource.from_url(
|
||||
player = await audio.YTDLSource.from_url(
|
||||
" ".join(query), loop=client.loop, stream=True
|
||||
)
|
||||
player.volume = float(args.volume) / 100.0
|
||||
@@ -162,7 +162,7 @@ async def queue_or_play(message, edited=False):
|
||||
await utils.reply(message, f"**failed to queue:** `{e}`")
|
||||
return
|
||||
|
||||
queued = youtubedl.QueuedSong(player, message)
|
||||
queued = audio.QueuedSong(player, message)
|
||||
|
||||
if args.now or args.next:
|
||||
players[message.guild.id].queue_add_front(queued)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import disnake
|
||||
|
||||
import audio
|
||||
import sponsorblock
|
||||
import utils
|
||||
import youtubedl
|
||||
from constants import EMBED_COLOR
|
||||
from state import players
|
||||
|
||||
@@ -32,7 +32,7 @@ async def sponsorblock_command(message):
|
||||
|
||||
current = "**" if progress >= begin and progress < end else ""
|
||||
text.append(
|
||||
f"{current}`{youtubedl.format_duration(begin)}` - `{youtubedl.format_duration(end)}`: {category_name if category_name else 'Unknown'}{current}"
|
||||
f"{current}`{audio.format_duration(begin)}` - `{audio.format_duration(end)}`: {category_name if category_name else 'Unknown'}{current}"
|
||||
)
|
||||
|
||||
await utils.reply(
|
||||
|
Reference in New Issue
Block a user