-
-
Save waki285/8a2328f106f5d73648c5ad8c79ce0897 to your computer and use it in GitHub Desktop.
認証
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client.on('ready', () => { | |
client.channels.cache.get("リアクション付けるメッセージのチャンネルID").messages.fetch("リアクション付けるメッセージID"); | |
}); | |
client.on('messageReactionAdd', async (reaction, user) => { | |
if (reaction.message.id !== "リアクション付けるメッセージID") return; | |
if (user.bot) return; | |
reaction.remove(); | |
const num = Math.floor(Math.random() * 9000000000)+ 1000000000; | |
const msg = await user.send(`次の数字を送信してください → ${num}`); | |
msg.channel.awaitMessages((m) => true, { max: 1, time: 1000 * 60}) | |
.then(collected => { | |
if (!collected.size) return; | |
const m = collected.first(); | |
if (m.content === String(num)) { | |
msg.channel.send("認証完了"); | |
reaction.guild.member(user.id).roles.add("メンバーロールのID"); | |
} else { | |
msg.channel.send("コードが違います\nリアクションからやり直してください"); | |
} | |
}); | |
}); |
メンバーロールのIDとは何ですか?
認証された後に付与されるロールのIDです
DMに数字は送られてきましたがロールが付与されません、
エラーは出ていますか?
エラーは出ていません
ロールが付与できないだけです
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
メンバーロールのIDとは何ですか?