タイトルはほとんどすべてです。私は試しました.addField(`**Nickname (If Applicable):**`, `${usr.nickname}`)
がundefined
、埋め込みに表示されます...しかし、存在感のために、私は試しました.addField(`**Status:**`, `${usr.presence}`)
。それは私[object Object]
に埋め込みを与えます。誰か助けてもらえますか?
まず、GuildMemberオブジェクトのステータスを取得することはできませんが、最初にそれをユーザーオブジェクトに変換する必要があります。これは、次のように簡単に実行できます。
const memberObject = <guild>.members.cache.get('place id here') // Gives you the member object
// or alternatively you could search for him using his name using the .find() function
const userObject = memberObject.user // Gives you the user object of the member
そこから、次のコマンドを使用して、ユーザーのニックネームとステータスを簡単に確認できます。
console.log(userObject.presence.status)
console.log(memberObject.nickname)
うまくいけば、これが役立ちます!
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加