【发布时间】:2022-12-17 23:27:20
【问题描述】:
我正在用 discord py 制作一个 discord bot 但我有一个问题: 我的问题是,当我们亲爱的会员点击 $stop 命令时,声音不应该继续 * 机器人不应该死,只有声音应该停止 我的代码:
@app.command()
async def stop(ctx):
voice = discord.utils.get(app.voice_clients, guild=ctx.guild)
if voice == None:
await ctx.send(f"hey {ctx.author.mention} first bot need to join a voice channel!")
elif (ctx.author.voice) == None:
await ctx.send(f"hey {ctx.author.mention} first you need join to a voice channel!")
else:
# voice_1 = ctx.message.author.voice.channel
await voice.stop()
【问题讨论】:
标签: python discord.py