/// <summary> /// Modifies the role /// </summary> /// <param name="properties">Options for modifying the role</param> public new void Modify(RoleProperties properties) { DiscordRole role = base.Modify(properties); Name = role.Name; Permissions = role.Permissions; Color = role.Color; Seperated = role.Seperated; Position = role.Position; }
public void Authorize(ulong guildId, DiscordPermissions permissions, string captchaKey) { Client.AuthorizeBot(Id, guildId, permissions, captchaKey); }
/// <summary> /// Adds a bot to a server /// </summary> /// <param name="botId">client_id from the oauth2 url</param> /// <param name="guildId">the guild to add the bot to</param> /// <param name="permissions">permissions the bot should have</param> /// <param name="captchaKey">captcha key used to validate the request</param> public static void AuthorizeBot(this DiscordClient client, ulong botId, ulong guildId, DiscordPermissions permissions, string captchaKey) { client.HttpClient.Post($"/oauth2/authorize?client_id={botId}&scope=bot", JsonConvert.SerializeObject(new DiscordBotAuthorization() { GuildId = guildId, Permissions = permissions, CaptchaKey = captchaKey })); }