Beispiel #1
0
        internal static async Task <bool> Confirmation(CommandObjects CommandObject)
        {
            string AuthCode = RandomCodeGenerate();
            await CommandObject.Member.SendMessageAsync(AuthCode);

            DiscordMessage BotSendMessage = await CommandObject.Message.Channel.SendMessageAsync("処理を実行する前に確認のためDMに送信した6文字のコードを入力してください");

            DiscordMessage AuthSend = await BotSendMessage.AwaitMessage(CommandObject.Message.Author.Id, 1 * 60 * 1000);

            if (AuthSend == null)
            {
                return(false);
            }

            if (AuthSend.Content != AuthCode)
            {
                await CommandObject.Message.Channel.SendMessageAsync("コードが違います");

                return(false);
            }

            return(true);
        }