Skip to content

Commit 5e45d23

Browse files
committed
fix!: make flags long per default and add Unknown
Renamed some flags in ApplicationFlags and UserFlags
1 parent 40b5ae7 commit 5e45d23

20 files changed

+202
-109
lines changed

DisCatSharp.Attributes/Features.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,34 @@ namespace DisCatSharp.Attributes;
99
public enum Features : long
1010
{
1111
[FeatureDescription("Requires that you specify an override in the DiscordConfiguration.")]
12-
Override = 1 << 0,
12+
Override = 1L << 0,
1313

1414
[FeatureDescription("Requires that the guild has onboarding enabled.")]
15-
Onboarding = 1 << 1,
15+
Onboarding = 1L << 1,
1616

1717
[FeatureDescription("Requires that the guild is partnered.")]
18-
Partnered = 1 << 2,
18+
Partnered = 1L << 2,
1919

2020
[FeatureDescription("Requires that the guild is verified.")]
21-
Verified = 1 << 3,
21+
Verified = 1L << 3,
2222

2323
[FeatureDescription("Requires that the guild has discovery enabled.")]
24-
Discoverable = 1 << 4,
24+
Discoverable = 1L << 4,
2525

2626
[FeatureDescription("Requires that the guild has community enabled.")]
27-
Community = 1 << 5,
27+
Community = 1L << 5,
2828

2929
[FeatureDescription("Requires that the guild has monetization enabled.")]
30-
ServerSubscription = 1 << 6,
30+
ServerSubscription = 1L << 6,
3131

3232
[FeatureDescription("Requires that the application has monetization enabled.")]
33-
MonetizedApplication = 1 << 7,
33+
MonetizedApplication = 1L << 7,
3434

3535
[FeatureDescription("Requires that the user and/or guild has a specific experiment and/or treatment.")]
36-
Experiment = 1 << 8
36+
Experiment = 1L << 8,
37+
38+
[FeatureDescription("The requirements are unknown.")]
39+
Unknown = long.MaxValue
3740
}
3841

3942
/// <summary>

DisCatSharp.Docs/changelogs/v10/10_7_0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ In our best effort we tried to patch it over and over again, but we can't guaran
104104
- **LavalinkGuildPlayer**: `RemoveQueue` renamed to [`RemoveFromQueue`]((xref:DisCatSharp.Lavalink.Entities.LavalinkGuildPlayer.RemoveFromQueue*)).
105105
- **Url fields**: Any `Url` fields on objects like `DiscordAttachment`, `DiscordEmbed`, etc., are now of type [`DiscordUri`](xref:DisCatSharp.Entities.DiscordUri) instead of `string`. Use `.ToUri()` to get a `Uri` object or use `.ToString()`.
106106
- We updated some namespaces in DisCatSharp.Interactivity. You might need to update your imports for some entities and enums.
107+
- Flags are now of the type `long` instead of `int`.
108+
- Renamed some flags in [`ApplicationFlags`](xref:DisCatSharp.Enums.ApplicationFlags) and [`UserFlags`](xref:DisCatSharp.Enums.UserFlags) to be more consistent with Discords API.
107109

108110
### ➕ Additions
109111

DisCatSharp/Entities/Message/DiscordUnfurledMedia.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ internal DiscordUnfurledMedia()
6767
/// Gets the loading state.
6868
/// </summary>
6969
[JsonProperty("loading_state", NullValueHandling = NullValueHandling.Ignore)]
70-
public LoadingState LoadingState { get; internal set; }
70+
public LoadingState LoadingState { get; internal set; } = LoadingState.Unknown;
7171
}

DisCatSharp/Enums/Application/ApplicationDiscoveryEligibilityFlags.cs

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,85 +25,90 @@ public enum ApplicationDiscoveryEligibilityFlags : long
2525
/// <summary>
2626
/// Application is verified.
2727
/// </summary>
28-
Verified = 1 << 0,
28+
Verified = 1L << 0,
2929

3030
/// <summary>
3131
/// Application has at least one tag set.
3232
/// </summary>
33-
Tag = 1 << 1,
33+
Tag = 1L << 1,
3434

3535
/// <summary>
3636
/// Application has a description.
3737
/// </summary>
38-
Description = 1 << 2,
38+
Description = 1L << 2,
3939

4040
/// <summary>
4141
/// Applications has a terms of service.
4242
/// </summary>
43-
TermsOfService = 1 << 3,
43+
TermsOfService = 1L << 3,
4444

4545
/// <summary>
4646
/// Application has a privacy policy.
4747
/// </summary>
48-
PrivacyPolicy = 1 << 4,
48+
PrivacyPolicy = 1L << 4,
4949

5050
/// <summary>
5151
/// Application has custom install url or install params.
5252
/// </summary>
53-
InstallParams = 1 << 5,
53+
InstallParams = 1L << 5,
5454

5555
/// <summary>
5656
/// Application's name is safe for work.
5757
/// </summary>
58-
SafeName = 1 << 6,
58+
SafeName = 1L << 6,
5959

6060
/// <summary>
6161
/// Application's description is safe for work.
6262
/// </summary>
63-
SafeDescription = 1 << 7,
63+
SafeDescription = 1L << 7,
6464

6565
/// <summary>
6666
/// Application has the message content approved or utilizes application commands.
6767
/// </summary>
68-
ApprovedCommandsOrMessageContent = 1 << 8,
68+
ApprovedCommandsOrMessageContent = 1L << 8,
6969

7070
/// <summary>
7171
/// Application has a support guild set.
7272
/// </summary>
73-
SupportGuild = 1 << 9,
73+
SupportGuild = 1L << 9,
7474

7575
/// <summary>
7676
/// Application's commands are safe for work.
7777
/// </summary>
78-
SafeCommands = 1 << 10,
78+
SafeCommands = 1L << 10,
7979

8080
/// <summary>
8181
/// Application's owner has MFA enabled.
8282
/// </summary>
83-
Mfa = 1 << 11,
83+
Mfa = 1L << 11,
8484

8585
/// <summary>
8686
/// Application's directory long description is safe for work.
8787
/// </summary>
88-
SafeDirectoryOverview = 1 << 12,
88+
SafeDirectoryOverview = 1L << 12,
8989

9090
/// <summary>
9191
/// Application has at least one supported locale set.
9292
/// </summary>
93-
SupportedLocales = 1 << 13,
93+
SupportedLocales = 1L << 13,
9494

9595
/// <summary>
9696
/// Application's directory short description is safe for work.
9797
/// </summary>
98-
SafeShortDescription = 1 << 14,
98+
SafeShortDescription = 1L << 14,
9999

100100
/// <summary>
101101
/// Application's role connections metadata is safe for work.
102102
/// </summary>
103-
SafeRoleConnections = 1 << 15,
103+
SafeRoleConnections = 1L << 15,
104104

105105
/// <summary>
106106
/// Application has met all criteria and is eligible for discovery.
107107
/// </summary>
108-
Eligible = 1 << 16
108+
Eligible = 1L << 16,
109+
110+
/// <summary>
111+
/// The flags are unknown.
112+
/// </summary>
113+
Unknown = long.MaxValue
109114
}

DisCatSharp/Enums/Application/ApplicationFlags.cs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,24 @@ public enum ApplicationFlags : long
5252
GameProfileDisabled = 1L << 7,
5353

5454
/// <summary>
55-
/// Allows the application to create activity assets.
55+
/// The application's OAuth2 credentials are public.
5656
/// </summary>
57-
AllowAssets = 1L << 8,
57+
PublicOAuth2Client = 1L << 8,
5858

5959
/// <summary>
6060
/// The application's activity can be launched without a context.
6161
/// </summary>
6262
ContextlessActivity = 1L << 9,
6363

6464
/// <summary>
65-
/// Allows the application to enable activity spectating.
65+
/// The application has limited access to the social layer SDK.
6666
/// </summary>
67-
[DiscordDeprecated("Replaced by ContextlessActivity")]
68-
AllowActivityActionSpectate = ContextlessActivity,
69-
70-
/// <summary>
71-
/// Allows the application to enable join requests for activities.
72-
/// </summary>
73-
AllowActivityActionJoinRequest = 1L << 10,
67+
SocialLayerIntegrationLimited = 1L << 10,
7468

7569
/// <summary>
7670
/// The application has connected to RPC.
7771
/// </summary>
72+
[DiscordDeprecated]
7873
RpcHasConnected = 1L << 11,
7974

8075
/// <summary>
@@ -123,9 +118,9 @@ public enum ApplicationFlags : long
123118
EmbeddedFirstParty = 1L << 20,
124119

125120
/// <summary>
126-
/// To be datamined.
121+
/// The application has been migrated to the new application command system.
127122
/// </summary>
128-
UnknownFlag = 1L << 21,
123+
ApplicationCommandMigrated = 1L << 21,
129124

130125
/// <summary>
131126
/// The application has registered global application commands.
@@ -138,25 +133,33 @@ public enum ApplicationFlags : long
138133
/// </summary>
139134
Active = 1L << 24,
140135

136+
/// <summary>
137+
/// Indicates if an application has not had any global application commands used in the last 30 days and has lost the <see cref="Active"/> flag.
138+
/// </summary>
139+
AcitiveGracePeriod = 1L << 25,
140+
141141
/// <summary>
142142
/// Allows the app to use Iframe modals.
143143
/// </summary>
144144
IframeModal = 1L << 26,
145145

146146
/// <summary>
147-
/// Indicates if an app is a social layer integration.
148-
/// days.
147+
/// Indicates if an app can use the social layer SDK.
149148
/// </summary>
150149
SocialLayerIntegration = 1L << 27,
151150

152151
/// <summary>
153152
/// Indicates if an app is promoted by discord.
154-
/// days.
155153
/// </summary>
156154
Promoted = 1L << 29,
157155

158156
/// <summary>
159157
/// Indicates if an app is partnered with discord.
160158
/// </summary>
161-
Partner = 1L << 30
159+
Partner = 1L << 30,
160+
161+
/// <summary>
162+
/// The flags are unknown.
163+
/// </summary>
164+
Unknown = long.MaxValue
162165
}

DisCatSharp/Enums/Application/ApplicationMonetizationEligibilityFlags.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,10 @@ public enum ApplicationMonetizationEligibilityFlags : long
115115
/// <summary>
116116
/// The team has a valid payout status
117117
/// </summary>
118-
ValidPayoutStatus = 1 << 18
118+
ValidPayoutStatus = 1 << 18,
119+
120+
/// <summary>
121+
/// The flags are unknown.
122+
/// </summary>
123+
Unknown = long.MaxValue
119124
}

DisCatSharp/Enums/Application/ApplicationVerificationEligibilityFlags.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,10 @@ public enum ApplicationVerificationEligibilityFlags : long
108108
EligibleForVerification = HasTeam | SafeApplicationName | SafeApplicationDescription | SafeApplicationRoleConnectionsMetadata |
109109
TermsOfService | PrivacyPolicy | InviteLink | NotEmbedded | NoUnapprovedIntents | UserIsTeamOwner |
110110
TeamOwnerIsVerified | User2FaEnabled | UserEmailVerified | TeamMembersEmailVerified | TeamMembers2FaEnabled |
111-
NoBlockingIssues
111+
NoBlockingIssues,
112+
113+
/// <summary>
114+
/// The flags are unknown.
115+
/// </summary>
116+
Unknown = long.MaxValue
112117
}

DisCatSharp/Enums/Channel/ChannelFlags.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,10 @@ public enum ChannelFlags : long
118118
/// <summary>
119119
/// Channel is obfuscated.
120120
/// </summary>
121-
Obfuscated = 1L << 17
121+
Obfuscated = 1L << 17,
122+
123+
/// <summary>
124+
/// The flags are unknown.
125+
/// </summary>
126+
Unknown = long.MaxValue
122127
}

DisCatSharp/Enums/Guild/MemberFlags.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,10 @@ public enum MemberFlags : long
8989
/// Members clan tag is blocked by AutoMod.
9090
/// </summary>
9191
[DiscordInExperiment]
92-
AutomodQuarantinedClanTag = 1 << 10
92+
AutomodQuarantinedClanTag = 1 << 10,
93+
94+
/// <summary>
95+
/// The flags are unknown.
96+
/// </summary>
97+
Unknown = long.MaxValue
9398
}

DisCatSharp/Enums/Guild/Permission.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,12 @@ public enum Permissions : long
386386
/// This only applies to apps not also installed to the server.
387387
/// </summary>
388388
[PermissionString("Use External Apps")]
389-
UseExternalApps = 1L << 50
389+
UseExternalApps = 1L << 50,
390+
391+
/// <summary>
392+
/// The flags are unknown.
393+
/// </summary>
394+
Unknown = long.MaxValue
390395
}
391396

392397
/// <summary>

DisCatSharp/Enums/Guild/RoleFlags.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace DisCatSharp.Enums;
66
/// Represents additional details of a role.
77
/// </summary>
88
[Flags]
9-
public enum RoleFlags
9+
public enum RoleFlags : long
1010
{
1111
/// <summary>
1212
/// This role has no flags.
@@ -16,5 +16,10 @@ public enum RoleFlags
1616
/// <summary>
1717
/// This role is in a prompt.
1818
/// </summary>
19-
InPrompt = 1 << 0
19+
InPrompt = 1L << 0,
20+
21+
/// <summary>
22+
/// The flags are unknown.
23+
/// </summary>
24+
Unknown = long.MaxValue
2025
}

DisCatSharp/Enums/Guild/SystemChannelFlags.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,45 @@ public static bool HasSystemChannelFlag(this SystemChannelFlags? baseFlags, Syst
2525
/// Represents settings for a guild's system channel.
2626
/// </summary>
2727
[Flags]
28-
public enum SystemChannelFlags
28+
public enum SystemChannelFlags : long
2929
{
3030
/// <summary>
3131
/// Member join messages are disabled.
3232
/// </summary>
33-
SuppressJoinNotifications = 1 << 0,
33+
SuppressJoinNotifications = 1L << 0,
3434

3535
/// <summary>
3636
/// Server boost messages are disabled.
3737
/// </summary>
38-
SuppressPremiumSubscriptions = 1 << 1,
38+
SuppressPremiumSubscriptions = 1L << 1,
3939

4040
/// <summary>
4141
/// Server setup tips are disabled.
4242
/// </summary>
43-
SuppressGuildReminderNotifications = 1 << 2,
43+
SuppressGuildReminderNotifications = 1L << 2,
4444

4545
/// <summary>
4646
/// Suppress member join sticker replies.
4747
/// </summary>
48-
SuppressJoinNotificationReplies = 1 << 3,
48+
SuppressJoinNotificationReplies = 1L << 3,
4949

5050
/// <summary>
5151
/// Role subscription purchase messages are disabled.
5252
/// </summary>
53-
SuppressRoleSubbscriptionPurchaseNotification = 1 << 4,
53+
SuppressRoleSubbscriptionPurchaseNotification = 1L << 4,
5454

5555
/// <summary>
5656
/// Suppress role subscription purchase sticker replies.
5757
/// </summary>
58-
SuppressRoleSubbscriptionPurchaseNotificationReplies = 1 << 5,
58+
SuppressRoleSubbscriptionPurchaseNotificationReplies = 1L << 5,
5959

6060
/// <summary>
6161
/// Suppress deadchat channel prompts.
6262
/// </summary>
63-
SuppressChannelPromptDeadchat = 1 << 7
63+
SuppressChannelPromptDeadchat = 1L << 7,
64+
65+
/// <summary>
66+
/// The flags are unknown.
67+
/// </summary>
68+
Unknown = long.MaxValue
6469
}

0 commit comments

Comments
 (0)