Merge branch 'develop' into master #patch
This commit is contained in:
commit
b9145ea22b
@ -60,12 +60,7 @@ namespace ChaosBot.WebServer.App
|
||||
string responseString = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
|
||||
DiscordUserResponse userResponse = JsonConvert.DeserializeObject<DiscordUserResponse>(responseString);
|
||||
|
||||
return Json(new
|
||||
{
|
||||
id = userResponse.id,
|
||||
username = $"{userResponse.username}#{userResponse.discriminator}",
|
||||
avatar = userResponse.avatar
|
||||
});
|
||||
return Json(userResponse);
|
||||
}
|
||||
|
||||
[HttpGet("guilds")]
|
||||
@ -90,40 +85,39 @@ namespace ChaosBot.WebServer.App
|
||||
|
||||
internal class DiscordOauthResponse
|
||||
{
|
||||
public string error = null;
|
||||
public string error_description = null;
|
||||
|
||||
public string access_token = null;
|
||||
public int expires_in = 0;
|
||||
public string refresh_token = null;
|
||||
public string scope = null;
|
||||
public string token_type = null;
|
||||
public string error { get; set; } = null;
|
||||
public string error_description { get; set; } = null;
|
||||
public string access_token { get; set; } = null;
|
||||
public int expires_in { get; set; } = 0;
|
||||
public string refresh_token { get; set; } = null;
|
||||
public string scope { get; set; } = null;
|
||||
public string token_type { get; set; } = null;
|
||||
}
|
||||
|
||||
public class DiscordUserResponse
|
||||
{
|
||||
public string id;
|
||||
public string username;
|
||||
public string discriminator;
|
||||
public string avatar = null;
|
||||
public bool bot = false;
|
||||
public bool system = false;
|
||||
public bool mfa_enabled = false;
|
||||
public string locale = null;
|
||||
public bool verified = false;
|
||||
public string email = null;
|
||||
public int flags = 0;
|
||||
public int premium_type = 0;
|
||||
public int public_flags = 0;
|
||||
public string id { get; set; }
|
||||
public string username { get; set; }
|
||||
public string discriminator { get; set; }
|
||||
public string avatar { get; set; } = null;
|
||||
public bool bot { get; set; } = false;
|
||||
public bool system { get; set; } = false;
|
||||
public bool mfa_enabled { get; set; } = false;
|
||||
public string locale { get; set; } = null;
|
||||
public bool verified { get; set; } = false;
|
||||
public string email { get; set; } = null;
|
||||
public int flags { get; set; } = 0;
|
||||
public int premium_type { get; set; } = 0;
|
||||
public int public_flags { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class DiscordGuildResponse
|
||||
{
|
||||
public string id;
|
||||
public string name;
|
||||
public string icon;
|
||||
public bool owner;
|
||||
public int permissions;
|
||||
public int permissions_new;
|
||||
public string id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public bool owner { get; set; }
|
||||
public int permissions { get; set; }
|
||||
public int permissions_new { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user