小编Eey*_*yeo的帖子

如何使用 python 更改不和谐机器人的音量?

我希望用户能够更改我的不和谐音乐机器人的音量。我尝试过这样做,但似乎不起作用。我已经将 vc 定义为外面的“东西”,然后用它在 try 和 except 中播放音乐。我想知道这是否导致了问题。

elif contents.startswith("volume"):
            volume = contents
            volume = volume.strip("volume ")
            volume = int(volume)

            if volume <= 100:
                volume = volume / 10
                vc.source = discord.PCMVolumeTransformer(vc.source)
                vc.source.volume = volume
            else:
                message.channel.send("Please give me a number between 0 and 100!")
Run Code Online (Sandbox Code Playgroud)

python volume discord

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

discord ×1

python ×1

volume ×1