使用 python 在 Nextcord 中为不和谐机器人创建一个队列
我正在尝试使用 nextcord 制作一个音乐不和谐机器人,我设法制作了一个播放命令,但是当我播放一首歌并放置另一首歌曲时,它就会改变,我想排队解决这个问题,但我不知道在哪里开始,有人能帮忙吗?
这是我的播放命令:
@bot.command()
async def play(ctx: commands.Context, *, search: wavelink.YouTubeTrack):
if not ctx.voice_client:
vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player)
else:
vc: wavelink.Player = ctx.voice_client
await vc.play(search)
await ctx.send(f"Now playing: `{search.title}`")
I'm trying to make a music discord bot using nextcord, I managed to make a play command but when I play a song and put another song it just changes, I want to queue to solve this problem but I don't know where to start, can anyone help?
this is my play command:
@bot.command()
async def play(ctx: commands.Context, *, search: wavelink.YouTubeTrack):
if not ctx.voice_client:
vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player)
else:
vc: wavelink.Player = ctx.voice_client
await vc.play(search)
await ctx.send(f"Now playing: `{search.title}`")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论