有没有办法让机器人使用模板?我知道有一种方法可以创建模板 Create Server Template discord.js或者用手做。但是有没有办法通过机器人应用模板呢?就像这样:
message.guild.applyTemplate('TemplateUrl')
message.guild.useTemplate('TemplateUrl')
最佳答案
是的,现在可以使用 <GuildTemplate>.sync()
.
Syncs this template to the current state of the guild.
Returns: Promise
初始答案 (Discord.js v12)
使用 Discord.js:还没有。
使用 Discord API:技术上是
到目前为止,还没有办法将服务器模板与discord.js 机器人一起应用。然而,Official Discord Devs Docs 中提到了一些有趣的事情。 .
PUT
/guilds/{guild.id}/templates/{template.code}
Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the guild template object on success.
来源:https://discord.com/developers/docs/resources/guild-template#sync-guild-template
Discord.js v13 介绍中还提到了 Guild Template API 支持 Update Notes/Changes in v13 .
GuildTemplate Provides API support for server templates
一旦 Discord.js v13 发布,我将调整这个答案。
关于javascript - 应用服务器模板discord.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68649275/