/// <summary> /// Deletes this integration, if this is a guild integration. /// <para>You can check if this is a guild integration, if <see cref="GuildId"/> is not null.</para> /// <para>Requires <see cref="DiscordPermission.ManageGuild"/>.</para> /// </summary> /// <exception cref="DiscordHttpApiException"></exception> /// <exception cref="InvalidOperationException">Thrown if this is not a guild integration.</exception> public Task Delete() { if (!GuildId.HasValue) { throw new InvalidOperationException("This integration does not represent a guild integration"); } return(http.DeleteGuildIntegration(GuildId.Value, Id)); }