이 코드가 있:
@commands.command(pass_context=True, aliases= ["aq"])
async def add_queue(self, ctx, *, url):
a = ctx.message.guild.id
b = servers[a]
global queue
try:
b[len(b)] = url
user = ctx.message.author.mention
await ctx.send(f'``{url}`` was added to the queue by {user}!')
except:
await ctx.send(f"Couldnt add {url} to the queue!")
@commands.command(pass_context=True, aliases= ["qp"], case_insensitive=True)
async def pq(self,ctx, number):
a = ctx.message.guild.id
b = servers[a]
if int(number) in b:
source = b[int(number)]
self.cur_song_id = int(number)
await ctx.send(f"**Now Playing:** {source}")
await self.transformer(ctx, source)
async def transformer(self,ctx, url):
player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True)
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel!")
return
elif ctx.voice_client and ctx.voice_client.is_connected():
print('Already connected to voice')
pass
else:
channel = ctx.message.author.voice.channel
await ctx.send(f'Connected to ``{channel}``')
await channel.connect()
ctx.voice_client.play(player)
내가 만들 수 있는 별도의 큐에 대한 각각의 서버에 추가한 노래하는 그 명령에 의하여:
-aq song_name
예 큐:
Your current queue is {0: 'abcdefu', 1: 'stereo hearts', 2: 'shivers'}
나는 재생할 수 있습 노래와 함께 큐에 명령:
-pq 0 or -pq 1 or -pq 2
하지만 문제는 로봇만을 재생하는 노래를 중지한 후 그것은 완료,그리고 내가 원하는 로봇을 노래한 후 현재 노래를 완료하고 가는 것을 계속할 때까지 마지막 노래 큐에서 재생됩니다.
저를 도와주세요합니다....
사전에 감사합니다!!!