問題描述
我一直在嘗試使用 discord.js 制作一個不和諧機器人,但我似乎找不到任何有關如何創建在 2018 年工作的角色的文檔.所有我能找到的工作,不再工作,因為他們已經刪除了引用的功能.在 https://discord.js.org/#/docs/main/stable/class/Role 沒有提到 createRole("role", "roleName");類型函數.
I've been trying to make a discord bot using discord.js, but I can't seem to find any documentation on how to create a role that works in 2018. All the ones I can find that work, no longer work as they have removed the referenced function. In https://discord.js.org/#/docs/main/stable/class/Role there is no mention of a createRole("role", "roleName"); type function.
如果有人可以提供幫助,那就太好了!
If anyone could help that would be great!
推薦答案
Role
類沒有創建新角色的方法,必須看Guild
上課.這是該方法的文檔鏈接:https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=createRole.如果您有任何問題,請隨時發表評論!
The class Role
does not have the method to create a new role, you must look at the Guild
class for that. Here is a link to the documentation for the method: https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=createRole. Feel free to comment back if you have any questions!
從 discord.js v12 開始,createRole
不再存在,請參閱上面 cecomp64 關于使用新 RoleManager創建新角色的回答代碼>對象.
這篇關于如何使用 discord.js 創建角色的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!