получить Discord токен у аккаунта

Jas

Client
Регистрация
29.11.2022
Сообщения
14
Благодарностей
0
Баллы
1
Добрый день! Требуется получить токен у дискорд аккаунта

Смотрел здесь темы по поиску и решение не дало результаты, возможно что-то поменялось в самой политике дискорда
Пытался также найти шаблоны, но видимо я плохо ищу. Если есть, наведите, пожалуйста

Сталкивался ли кто сейчас с этим вопросом, подскажите пожалуйста)
 

Nats1

Client
Регистрация
15.04.2015
Сообщения
197
Благодарностей
194
Баллы
43
Оно? :-)
C#:
using System;
using System.Net;
using System.IO;

namespace DiscordToken
{
    class Program
    {
        static void Main(string[] args)
        {
            string clientId = "YOUR_CLIENT_ID";
            string clientSecret = "YOUR_CLIENT_SECRET";
            string redirectUri = "YOUR_REDIRECT_URI";

            string url = $"https://discordapp.com/api/oauth2/authorize?client_id={clientId}&redirect_uri={redirectUri}&response_type=code&scope=identify";

            Console.WriteLine("Open the following URL in your browser and authorize the application:");
            Console.WriteLine(url);

            Console.WriteLine("Enter the code from the URL:");
            string code = Console.ReadLine();

            string tokenUrl = $"https://discordapp.com/api/oauth2/token?client_id={clientId}&client_secret={clientSecret}&grant_type=authorization_code&code={code}&redirect_uri={redirectUri}&scope=identify";

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(tokenUrl);
            request.Method = "POST";

            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                {
                    string json = reader.ReadToEnd();
                    Console.WriteLine(json);
                }
            }
        }
    }
}
 
  • Спасибо
Реакции: evgenii2000, Sho и djaga

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)