-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement newly documented features since the start of the rewrite. (#…
…562) * Implement select menu default values * Implement entitlements * Export entitlement classes * Add tests for entitlements * Fix imports * Add entitlements test * Add entitlements to interaction structure * Add resolved data to message component interaction data * Add PREMIUM_REQUIRED interaction response type * Add SKU structure * Add missing fields to application object * Add update current application endpoint * Add new audit log entry types * Add integration_type field to audit log entry info * Add resolved data to message object * Add isVoiceMessage flag * Add missing reaction fields * Add missing attachment fields * Add guild media channel type * Add missing guild features * Add missing stage instance builder parameters * Add user avatar decoration * Add withCounts to list current user guilds endpoint * Add missing fields to MessageReactionAddEvent * Add missing fields to Role object * Implement team member roles * Rename ThreadAggregate to ThreadsOnlyChannel * Update application manager tests * Add flags to sample role * Update tests
- Loading branch information
1 parent
c31514b
commit 141e444
Showing
47 changed files
with
1,242 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'package:nyxx/src/builders/builder.dart'; | ||
import 'package:nyxx/src/builders/image.dart'; | ||
import 'package:nyxx/src/builders/sentinels.dart'; | ||
import 'package:nyxx/src/models/application.dart'; | ||
import 'package:nyxx/src/utils/flags.dart'; | ||
|
||
class ApplicationUpdateBuilder extends UpdateBuilder<Application> { | ||
Uri? customInstallUrl; | ||
|
||
String? description; | ||
|
||
Uri? roleConnectionsVerificationUrl; | ||
|
||
InstallationParameters? installationParameters; | ||
|
||
Flags<ApplicationFlags>? flags; | ||
|
||
ImageBuilder? icon; | ||
|
||
ImageBuilder? coverImage; | ||
|
||
Uri? interactionsEndpointUrl; | ||
|
||
List<String>? tags; | ||
|
||
ApplicationUpdateBuilder({ | ||
this.customInstallUrl, | ||
this.description, | ||
this.roleConnectionsVerificationUrl, | ||
this.installationParameters, | ||
this.flags, | ||
this.icon = sentinelImageBuilder, | ||
this.coverImage = sentinelImageBuilder, | ||
this.interactionsEndpointUrl, | ||
this.tags, | ||
}); | ||
|
||
@override | ||
Map<String, Object?> build() => { | ||
if (customInstallUrl != null) 'custom_install_url': customInstallUrl!.toString(), | ||
if (description != null) 'description': description, | ||
if (roleConnectionsVerificationUrl != null) 'role_connections_verification_url': roleConnectionsVerificationUrl!.toString(), | ||
if (installationParameters != null) | ||
'install_params': { | ||
'scopes': installationParameters!.scopes, | ||
'permissions': installationParameters!.permissions.toString(), | ||
}, | ||
if (flags != null) 'flags': flags!.value, | ||
if (!identical(icon, sentinelImageBuilder)) 'icon': icon?.buildDataString(), | ||
if (!identical(coverImage, sentinelImageBuilder)) 'cover_image': coverImage?.buildDataString(), | ||
if (tags != null) 'tags': tags, | ||
}; | ||
} |
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,29 @@ | ||
import 'package:nyxx/src/builders/builder.dart'; | ||
import 'package:nyxx/src/models/entitlement.dart'; | ||
import 'package:nyxx/src/models/snowflake.dart'; | ||
|
||
class TestEntitlementBuilder extends CreateBuilder<Entitlement> { | ||
Snowflake skuId; | ||
|
||
Snowflake ownerId; | ||
|
||
TestEntitlementType ownerType; | ||
|
||
TestEntitlementBuilder({required this.skuId, required this.ownerId, required this.ownerType}); | ||
|
||
@override | ||
Map<String, Object?> build() => { | ||
'sku_id': skuId.toString(), | ||
'owner_id': ownerId.toString(), | ||
'owner_type': ownerType.value, | ||
}; | ||
} | ||
|
||
enum TestEntitlementType { | ||
guildSubscription._(1), | ||
userSubscription._(2); | ||
|
||
final int value; | ||
|
||
const TestEntitlementType._(this.value); | ||
} |
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
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
Oops, something went wrong.