node.js - 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 位于同一目录中。
解决方案
推荐阅读
- android - SQLiteException:在“之间”附近:语法错误(代码 1)
- sharepoint-online - 为部分站点禁用租户范围的 SPFx 解决方案
- c++ - 为什么vector children没有被修改?
- docker - Docker - 卷内的卷?
- microsoft-graph-api - Microsoft Graph 资源管理器结帐返回状态代码 500“未知错误”
- javascript - 以特定字符串为前缀的数字的正则表达式的语法
- python - 如何在训练张量流期间获取输出层值
- java - 运行 Jar 文件时出错。IllegalStateException:未设置位置
- python - 如何仅打印输出的最大值
- python - Django表单cleaned_data完全缺少一个字段