-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] New
ModifyCurrentApplication
features (#2730)
* initial commit * apply suggestings lol * Update src/Discord.Net.Core/Entities/Applications/IApplication.cs Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com> * check for null values inside the array --------- Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
136 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 20 additions & 20 deletions
40
src/Discord.Net.Core/Entities/Applications/ApplicationInstallParams.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Discord | ||
namespace Discord; | ||
|
||
/// <summary> | ||
/// Represents install parameters for an application. | ||
/// </summary> | ||
public class ApplicationInstallParams | ||
{ | ||
/// <summary> | ||
/// Represents install parameters for an application. | ||
/// Gets the scopes to install this application. | ||
/// </summary> | ||
public class ApplicationInstallParams | ||
public IReadOnlyCollection<string> Scopes { get; } | ||
|
||
/// <summary> | ||
/// Gets the default permissions to install this application. | ||
/// </summary> | ||
public GuildPermission Permission { get; } | ||
|
||
public ApplicationInstallParams(string[] scopes, GuildPermission permission) | ||
{ | ||
/// <summary> | ||
/// Gets the scopes to install this application. | ||
/// </summary> | ||
public IReadOnlyCollection<string> Scopes { get; } | ||
Preconditions.NotNull(scopes, nameof(scopes)); | ||
|
||
/// <summary> | ||
/// Gets the default permissions to install this application | ||
/// </summary> | ||
public GuildPermission? Permission { get; } | ||
foreach (var s in scopes) | ||
Preconditions.NotNull(s, nameof(scopes)); | ||
|
||
internal ApplicationInstallParams(string[] scopes, GuildPermission? permission) | ||
{ | ||
Scopes = scopes.ToImmutableArray(); | ||
Permission = permission; | ||
} | ||
Scopes = scopes.ToImmutableArray(); | ||
Permission = permission; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Discord.API | ||
namespace Discord.API; | ||
|
||
internal class InstallParams | ||
{ | ||
internal class InstallParams | ||
{ | ||
[JsonProperty("scopes")] | ||
public string[] Scopes { get; set; } | ||
[JsonProperty("permissions")] | ||
public ulong Permission { get; set; } | ||
} | ||
[JsonProperty("scopes")] | ||
public string[] Scopes { get; set; } | ||
|
||
[JsonProperty("permissions")] | ||
public ulong Permission { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters