javascript - 从 url discord.js v13 播放音频
问题描述
如何使用 discord.js v13 从 url 播放音频。
我使用了这段代码,但它没有用。
const connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: message.guild.id,
adapterCreator: message.guild.voiceAdapterCreator,
})
const player = createAudioPlayer()
connection.subscribe(player)
const resource = createAudioResource(`http://www.site/audio.mp3`)
player.play(resource)
解决方案
推荐阅读
- r - 如何根据R中的成对比较制作矩阵?
- mysql - mysql:显示数据库不显示任何数据库
- scala - 为任意 scalafmt 设置保留现有代码
- php - 如何避免 Voyager 图像问题的故障?
- php - 创建新菜单时如何修复我的标题菜单更改?
- java - 运行任何 micronaut CLI 命令时出现致命错误
- asp.net-core - Signalr MessagePack .net core 3 和 UWP App
- mysql - 我正在努力从列中的数据中删除最后 30 个字符
- sql - 有没有办法使用 OVER 来计算组和子组?
- postgresql - 从 postgresql 服务器使用 postgresql-fdw 连接到 Hive 数据库表