Compare commits
5 Commits
019e60450f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
69f5af19ae
|
|||
|
7f402e7f52
|
|||
|
44dd986696
|
|||
|
5a4f277aa9
|
|||
|
17f5dca773
|
@@ -254,7 +254,7 @@ async def skip(message):
|
||||
if not command_allowed(message):
|
||||
return
|
||||
|
||||
if not players[message.guild.id].queue:
|
||||
if not players[message.guild.id] and not players[message.guild.id].queue:
|
||||
message.guild.voice_client.stop()
|
||||
await utils.reply(
|
||||
message,
|
||||
|
||||
15
extra.py
15
extra.py
@@ -2,7 +2,7 @@ import asyncio
|
||||
import string
|
||||
|
||||
import disnake
|
||||
import youtube_transcript_api
|
||||
from youtube_transcript_api._api import YouTubeTranscriptApi
|
||||
|
||||
from state import client, kill, players
|
||||
|
||||
@@ -15,9 +15,8 @@ async def transcript(
|
||||
upper=True,
|
||||
):
|
||||
initial_id = message.guild.voice_client.source.id
|
||||
transcript_list = youtube_transcript_api.YouTubeTranscriptApi.list_transcripts(
|
||||
initial_id,
|
||||
)
|
||||
transcript_list = YouTubeTranscriptApi().list(initial_id)
|
||||
|
||||
try:
|
||||
transcript = transcript_list.find_manually_created_transcript(languages).fetch()
|
||||
except Exception:
|
||||
@@ -25,21 +24,21 @@ async def transcript(
|
||||
await message.channel.send("(autogenerated)")
|
||||
|
||||
messages = []
|
||||
for line in transcript:
|
||||
for line in transcript.snippets:
|
||||
if (
|
||||
players[message.guild.id].current.player.original.progress
|
||||
>= line["start"] + line["duration"]
|
||||
>= line.start + line.duration
|
||||
):
|
||||
continue
|
||||
|
||||
while (
|
||||
players[message.guild.id].current.player.original.progress < line["start"]
|
||||
players[message.guild.id].current.player.original.progress < line.start
|
||||
):
|
||||
await asyncio.sleep(0.2)
|
||||
|
||||
messages.insert(
|
||||
0,
|
||||
await message.channel.send(line["text"].upper() if upper else line["text"]),
|
||||
await message.channel.send(line.text.upper() if upper else line.text),
|
||||
)
|
||||
if len(messages) > max_messages:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user