首页 > 解决方案 > Discord V13 mp3 播放

问题描述

const connection = joinVoiceChannel({
                            channelId: interaction.member.voice.channel.id,
                            guildId: interaction.guild.id,
                            adapterCreator: interaction.guild.voiceAdapterCreator,
                        });
                        const player = createAudioPlayer({
                            behaviors: {
                                noSubscriber: NoSubscriberBehavior.Pause,
                            },
                        });

                        const resource = createAudioResource('./test.mp3');
                        player.play(resource);
                        connection.subscribe(player)

这是我的代码:机器人加入语音频道但不播放声音。test.mp3 位于同一目录中。

标签: node.jsdiscord.js

解决方案


推荐阅读