-
-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add Role & Attachment flags (#2720)
* initial commit * oops * another typo -_- * Update AttachmentFlags.cs Made this on my phone lol * Update AttachmentFlags.cs * -line
- Loading branch information
Showing
9 changed files
with
150 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
|
||
namespace Discord; | ||
|
||
[Flags] | ||
public enum AttachmentFlags | ||
{ | ||
/// <summary> | ||
/// The attachment has no flags. | ||
/// </summary> | ||
None = 0, | ||
|
||
/// <summary> | ||
/// Indicates that this attachment is a clip. | ||
/// </summary> | ||
IsClip = 1 << 0, | ||
|
||
/// <summary> | ||
/// Indicates that this attachment is a thumbnail. | ||
/// </summary> | ||
IsThumbnail = 1 << 1, | ||
|
||
/// <summary> | ||
/// Indicates that this attachment has been edited using the remix feature on mobile. | ||
/// </summary> | ||
IsRemix = 1 << 2, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
|
||
namespace Discord; | ||
|
||
[Flags] | ||
public enum RoleFlags | ||
{ | ||
/// <summary> | ||
/// The role has no flags. | ||
/// </summary> | ||
None = 0, | ||
|
||
/// <summary> | ||
/// Indicates that the role can be selected by members in an onboarding. | ||
/// </summary> | ||
InPrompt = 1 << 0, | ||
} |
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,32 +1,45 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Discord.API | ||
namespace Discord.API; | ||
|
||
internal class Attachment | ||
{ | ||
internal class Attachment | ||
{ | ||
[JsonProperty("id")] | ||
public ulong Id { get; set; } | ||
[JsonProperty("filename")] | ||
public string Filename { get; set; } | ||
[JsonProperty("description")] | ||
public Optional<string> Description { get; set; } | ||
[JsonProperty("content_type")] | ||
public Optional<string> ContentType { get; set; } | ||
[JsonProperty("size")] | ||
public int Size { get; set; } | ||
[JsonProperty("url")] | ||
public string Url { get; set; } | ||
[JsonProperty("proxy_url")] | ||
public string ProxyUrl { get; set; } | ||
[JsonProperty("height")] | ||
public Optional<int> Height { get; set; } | ||
[JsonProperty("width")] | ||
public Optional<int> Width { get; set; } | ||
[JsonProperty("ephemeral")] | ||
public Optional<bool> Ephemeral { get; set; } | ||
[JsonProperty("duration_secs")] | ||
public Optional<double> DurationSeconds { get; set; } | ||
[JsonProperty("waveform")] | ||
public Optional<string> Waveform { get; set; } | ||
} | ||
[JsonProperty("id")] | ||
public ulong Id { get; set; } | ||
|
||
[JsonProperty("filename")] | ||
public string Filename { get; set; } | ||
|
||
[JsonProperty("description")] | ||
public Optional<string> Description { get; set; } | ||
|
||
[JsonProperty("content_type")] | ||
public Optional<string> ContentType { get; set; } | ||
|
||
[JsonProperty("size")] | ||
public int Size { get; set; } | ||
|
||
[JsonProperty("url")] | ||
public string Url { get; set; } | ||
|
||
[JsonProperty("proxy_url")] | ||
public string ProxyUrl { get; set; } | ||
|
||
[JsonProperty("height")] | ||
public Optional<int> Height { get; set; } | ||
|
||
[JsonProperty("width")] | ||
public Optional<int> Width { get; set; } | ||
|
||
[JsonProperty("ephemeral")] | ||
public Optional<bool> Ephemeral { get; set; } | ||
|
||
[JsonProperty("duration_secs")] | ||
public Optional<double> DurationSeconds { get; set; } | ||
|
||
[JsonProperty("waveform")] | ||
public Optional<string> Waveform { get; set; } | ||
|
||
[JsonProperty("flags")] | ||
public Optional<AttachmentFlags> Flags { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,42 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Discord.API | ||
namespace Discord.API; | ||
|
||
internal class Role | ||
{ | ||
internal class Role | ||
{ | ||
[JsonProperty("id")] | ||
public ulong Id { get; set; } | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
[JsonProperty("icon")] | ||
public Optional<string> Icon { get; set; } | ||
[JsonProperty("unicode_emoji")] | ||
public Optional<string> Emoji { get; set; } | ||
[JsonProperty("color")] | ||
public uint Color { get; set; } | ||
[JsonProperty("hoist")] | ||
public bool Hoist { get; set; } | ||
[JsonProperty("mentionable")] | ||
public bool Mentionable { get; set; } | ||
[JsonProperty("position")] | ||
public int Position { get; set; } | ||
[JsonProperty("permissions"), Int53] | ||
public string Permissions { get; set; } | ||
[JsonProperty("managed")] | ||
public bool Managed { get; set; } | ||
[JsonProperty("tags")] | ||
public Optional<RoleTags> Tags { get; set; } | ||
} | ||
[JsonProperty("id")] | ||
public ulong Id { get; set; } | ||
|
||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("icon")] | ||
public Optional<string> Icon { get; set; } | ||
|
||
[JsonProperty("unicode_emoji")] | ||
public Optional<string> Emoji { get; set; } | ||
|
||
[JsonProperty("color")] | ||
public uint Color { get; set; } | ||
|
||
[JsonProperty("hoist")] | ||
public bool Hoist { get; set; } | ||
|
||
[JsonProperty("mentionable")] | ||
public bool Mentionable { get; set; } | ||
|
||
[JsonProperty("position")] | ||
public int Position { get; set; } | ||
|
||
[JsonProperty("permissions"), Int53] | ||
public string Permissions { get; set; } | ||
|
||
[JsonProperty("managed")] | ||
public bool Managed { get; set; } | ||
|
||
[JsonProperty("tags")] | ||
public Optional<RoleTags> Tags { get; set; } | ||
|
||
[JsonProperty("flags")] | ||
public RoleFlags Flags { 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