Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 6.2.0 #646

Merged
merged 29 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
982e0d9
Implement `username`/`avatarUrl` params for `WebhookManager#execute` …
MCausc78 Dec 31, 2023
896004a
Update locale.dart (#610)
MCausc78 Dec 31, 2023
bb54de1
Prevent events from being dropped during the connection process (#612)
abitofevrything Dec 31, 2023
1a4ed82
Handle missing command permissions error (#613)
abitofevrything Dec 31, 2023
f6ef61b
Rate limit outgoing gateway events (#614)
abitofevrything Jan 5, 2024
4c7f7fa
Widen type of RoleUpdateBuilder.permissions (#617)
abitofevrything Jan 5, 2024
a1b2bc6
Export unexported types (#616)
abitofevrything Jan 5, 2024
ff92f86
Allow plugins to intercept HTTP requests and Gateway events (#615)
abitofevrything Jan 5, 2024
797579b
Correct serialization of request body in MessageManager.bulkDelete (#…
abitofevrything Jan 6, 2024
7ea4070
Parse GuildDeleteEvent.isUnavailable even when unavailable is not pre…
abitofevrything Jan 7, 2024
bad6daa
Correct getting started link in README (#620)
abitofevrything Jan 11, 2024
d9593c5
Correct serialization of guild builders (#621)
abitofevrything Jan 16, 2024
463cda9
fix (#623)
MCausc78 Jan 18, 2024
3e0ecdf
Hide model constructors in generated dartdocs (#624)
abitofevrything Jan 18, 2024
495b88f
Fix parsing role flags in guild templates (#625)
abitofevrything Jan 18, 2024
bb62547
Fixed hoist attribute in both role builder and role update builder (#…
HARUM1122 Jan 20, 2024
4ece7f7
Add more methods on models, bugfixes (#628)
MCausc78 Feb 17, 2024
7407767
Add `enforceNonce` field to `MessageBuilder` (#631)
MCausc78 Feb 17, 2024
0deacf8
impl (#632)
MCausc78 Feb 18, 2024
a1d89ca
Correct the user agent used by default (#633)
abitofevrything Feb 24, 2024
408fe03
Fix OAuth2 requiring `identify` scope, and add ability to quickly lis…
MCausc78 Mar 8, 2024
1e8d5e5
Add fields to delete events containing cached values before the delet…
MCausc78 Mar 12, 2024
2e09030
Add builders to auto moderation actions & moderation (#636)
abitofevrything Mar 12, 2024
02ee8a6
fix: Intialize logging sooner to prevent missed logs (#637)
Lexedia Mar 15, 2024
42f7bef
Add banner to UserUpdateBuilder, and `SkuFlags.available` (#638)
MCausc78 Mar 15, 2024
70c9d04
Add bungie/domain/roblox connection types and correct SkuFlags.availa…
MCausc78 Mar 16, 2024
10181ac
Add user apps (#641)
MCausc78 Mar 20, 2024
6adc5ff
Add `bulkBan` to `GuildManager` (#640)
MCausc78 Mar 29, 2024
e09aebe
Release 6.2.0 (#642)
abitofevrything Mar 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
## 6.2.0
__20.03.2024__

- feat: Add support for Group DM endpoints when using an OAuth client.
- feat: Add support for `username` and `avatarUrl` parameters for webhooks.
- feat: Add `Spanish, LATAM` locale.
- bug: Fix events being dropped when plugins had async initialization.
- bug: Return an empty list instead of throwing when fetching the permission overrides of a command that has none.
- feat: Add ratelimits when sending Gateway events.
- bug: Allow any `Flags<Permissions>` in `RoleUpdateBuilder.permissions`.
- bug: Export types that were previously kept private.
- feat: Allow plugins to intercept HTTP requests and Gateway events.
- bug: Fix `MessageManager.bulkDelete` not serializing the request correctly.
- bug: Fix `GuildDeleteEvent`s not being parsed when `unavailable` was not explicitly set.
- bug: Correct serialization of guild builders.
- bug: Correct value of `TriggerType.spam`.
- docs: Hide constructors from documentation.
- bug: Fix parsing role flags in guild templates.
- bug: Fix `isHoisted` attribute in role builders.
- bug: Fix all audit log parameters in `StickerManager`, `EmojiManager` and `WebhookManager.update`
- bug: Fix `interactionsEndpointUrl` being ignored in `ApplicationUpdateBuilder`
- feat: Add more shortcut methods on models.
- feat: Add `enforceNonce` to `MessageBuilder`.
- feat: Add missing role tags fields.
- bug: Correct the default `User-Agent` header.
- bug: Don't require OAuth2 identify scope when using `NyxxOauth2`.
- feat: Add field to delete events containing the cached entity before it was deleted.
- feat: Add builders for auto moderation actions.
- bug: Initialize login sooner to avoid dropping logs.
- feat: Add `banner` to `UserUpdateBuilder`.
- feat: Add `SkuFlags.available`.
- feat: Add bungie, domain and roblox connection types.
- feat: Add support for user applications.
- feat: Add `bulkBan` to `GuildManager`.

## 6.1.0
__09.21.2023__
__09.12.2023__

- feat: Add payload to `EntitlementDeleteEvent`.
- feat: Add `flags` field to `Sku`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

A complete, robust and efficient wrapper around Discord's API for bots & applications.

To get started using nyxx, follow our [getting started guide](https://nyxx.l7ssha.xyz/docs/guides/writing_your_first_bot) to write your first bot.
To get started using nyxx, follow our [getting started guide](https://nyxx.l7ssha.xyz/docs/tutorials/writing_your_first_bot) to write your first bot.

If you're already familiar with Discord's API, here's a quick example to get you started:
```dart
Expand Down
36 changes: 25 additions & 11 deletions lib/nyxx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ export 'src/errors.dart'
OutOfRemainingSessionsError,
IntegrationNotFoundException,
AlreadyAcknowledgedError,
AlreadyRespondedError;
AlreadyRespondedError,
PluginError;

export 'src/builders/builder.dart' show Builder, CreateBuilder, UpdateBuilder;
export 'src/builders/image.dart' show ImageBuilder;
export 'src/builders/user.dart' show UserUpdateBuilder;
export 'src/builders/permission_overwrite.dart' show PermissionOverwriteBuilder;
export 'src/builders/channel/channel_position.dart' show ChannelPositionBuilder;
export 'src/builders/channel/forum_tag.dart' show ForumTagBuilder;
export 'src/builders/channel/group_dm.dart' show GroupDmUpdateBuilder;
export 'src/builders/channel/group_dm.dart' show GroupDmUpdateBuilder, DmRecipientBuilder;
export 'src/builders/channel/guild_channel.dart'
show
ForumChannelUpdateBuilder,
Expand All @@ -45,15 +46,16 @@ export 'src/builders/message/attachment.dart' show AttachmentBuilder;
export 'src/builders/message/embed.dart' show EmbedBuilder, EmbedAuthorBuilder, EmbedFieldBuilder, EmbedFooterBuilder, EmbedImageBuilder, EmbedThumbnailBuilder;
export 'src/builders/message/message.dart' show MessageBuilder, MessageUpdateBuilder;
export 'src/builders/message/component.dart'
show ActionRowBuilder, ButtonBuilder, MessageComponentBuilder, SelectMenuBuilder, SelectMenuOptionBuilder, TextInputBuilder;
show ActionRowBuilder, ButtonBuilder, MessageComponentBuilder, SelectMenuBuilder, SelectMenuOptionBuilder, TextInputBuilder, DefaultValue;
export 'src/builders/webhook.dart' show WebhookBuilder, WebhookUpdateBuilder;
export 'src/builders/guild/guild.dart' show GuildBuilder, GuildUpdateBuilder;
export 'src/builders/guild/member.dart' show CurrentMemberUpdateBuilder, MemberBuilder, MemberUpdateBuilder;
export 'src/builders/guild/welcome_screen.dart' show WelcomeScreenUpdateBuilder;
export 'src/builders/guild/widget.dart' show WidgetSettingsUpdateBuilder;
export 'src/builders/guild/scheduled_event.dart' show ScheduledEventBuilder, ScheduledEventUpdateBuilder;
export 'src/builders/guild/template.dart' show GuildTemplateBuilder, GuildTemplateUpdateBuilder;
export 'src/builders/guild/auto_moderation.dart' show AutoModerationRuleBuilder, AutoModerationRuleUpdateBuilder;
export 'src/builders/guild/auto_moderation.dart'
show AutoModerationRuleBuilder, AutoModerationRuleUpdateBuilder, ActionMetadataBuilder, AutoModerationActionBuilder;
export 'src/builders/role.dart' show RoleBuilder, RoleUpdateBuilder;
export 'src/builders/voice.dart' show CurrentUserVoiceStateUpdateBuilder, VoiceStateUpdateBuilder, GatewayVoiceStateBuilder;
export 'src/builders/presence.dart' show PresenceBuilder, CurrentUserStatus, ActivityBuilder;
Expand All @@ -66,7 +68,7 @@ export 'src/builders/application_command.dart'
show ApplicationCommandBuilder, ApplicationCommandUpdateBuilder, CommandOptionBuilder, CommandOptionChoiceBuilder;
export 'src/builders/interaction_response.dart' show InteractionResponseBuilder, ModalBuilder, InteractionCallbackType;
export 'src/builders/entitlement.dart' show TestEntitlementBuilder, TestEntitlementType;
export 'src/builders/application.dart' show ApplicationUpdateBuilder;
export 'src/builders/application.dart' show ApplicationUpdateBuilder, ApplicationIntegrationTypeConfigurationBuilder;

export 'src/cache/cache.dart' show Cache, CacheConfig;

Expand Down Expand Up @@ -100,7 +102,8 @@ export 'src/http/managers/interaction_manager.dart' show InteractionManager;
export 'src/http/managers/entitlement_manager.dart' show EntitlementManager;

export 'src/gateway/gateway.dart' show Gateway;
export 'src/gateway/message.dart' show Disconnecting, Dispose, ErrorReceived, EventReceived, GatewayMessage, Send, Sent, ShardData, ShardMessage;
export 'src/gateway/message.dart'
show Disconnecting, Dispose, ErrorReceived, EventReceived, GatewayMessage, Send, Sent, ShardData, ShardMessage, Identify, RequestingIdentify, StartShard;
export 'src/gateway/shard.dart' show Shard;

export 'src/models/discord_color.dart' show DiscordColor;
Expand Down Expand Up @@ -140,7 +143,8 @@ export 'src/models/message/attachment.dart' show Attachment, AttachmentFlags;
export 'src/models/message/author.dart' show MessageAuthor;
export 'src/models/message/channel_mention.dart' show ChannelMention;
export 'src/models/message/embed.dart' show Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedProvider, EmbedThumbnail, EmbedVideo;
export 'src/models/message/message.dart' show Message, MessageFlags, PartialMessage, MessageType, MessageInteraction;
// ignore: deprecated_member_use_from_same_package
export 'src/models/message/message.dart' show Message, MessageFlags, PartialMessage, MessageType, MessageInteraction, MessageInteractionMetadata;
export 'src/models/message/reaction.dart' show Reaction, ReactionCountDetails;
export 'src/models/message/reference.dart' show MessageReference;
export 'src/models/message/role_subscription_data.dart' show RoleSubscriptionData;
Expand All @@ -160,7 +164,7 @@ export 'src/models/message/component.dart'
export 'src/models/invite/invite.dart' show Invite, TargetType;
export 'src/models/invite/invite_metadata.dart' show InviteWithMetadata;
export 'src/models/webhook.dart' show PartialWebhook, Webhook, WebhookType, WebhookAuthor;
export 'src/models/guild/ban.dart' show Ban;
export 'src/models/guild/ban.dart' show Ban, BulkBanResponse;
export 'src/models/guild/guild_preview.dart' show GuildPreview;
export 'src/models/guild/guild_widget.dart' show GuildWidget, WidgetSettings, WidgetImageStyle;
export 'src/models/guild/guild.dart'
Expand All @@ -174,15 +178,23 @@ export 'src/models/guild/guild.dart'
MfaLevel,
NsfwLevel,
PremiumTier,
VerificationLevel;
VerificationLevel,
UserGuild;
export 'src/models/guild/integration.dart' show PartialIntegration, Integration, IntegrationAccount, IntegrationApplication, IntegrationExpireBehavior;
export 'src/models/guild/member.dart' show Member, MemberFlags, PartialMember;
export 'src/models/guild/onboarding.dart' show Onboarding, OnboardingPrompt, OnboardingPromptOption, OnboardingPromptType;
export 'src/models/guild/welcome_screen.dart' show WelcomeScreen, WelcomeScreenChannel;
export 'src/models/guild/scheduled_event.dart' show EntityMetadata, PartialScheduledEvent, ScheduledEvent, ScheduledEventUser, EventStatus, ScheduledEntityType;
export 'src/models/guild/audit_log.dart' show AuditLogChange, AuditLogEntry, AuditLogEntryInfo, PartialAuditLogEntry, AuditLogEvent;
export 'src/models/application.dart'
show Application, ApplicationFlags, InstallationParameters, PartialApplication, ApplicationRoleConnectionMetadata, ConnectionMetadataType;
show
Application,
ApplicationFlags,
InstallationParameters,
PartialApplication,
ApplicationRoleConnectionMetadata,
ConnectionMetadataType,
ApplicationIntegrationType;
export 'src/models/guild/template.dart' show GuildTemplate;
export 'src/models/guild/auto_moderation.dart'
show
Expand Down Expand Up @@ -295,9 +307,11 @@ export 'src/models/interaction.dart'
ApplicationCommandInteraction,
MessageComponentInteraction,
ModalSubmitInteraction,
PingInteraction;
PingInteraction,
InteractionContextType;
export 'src/models/entitlement.dart' show Entitlement, PartialEntitlement, EntitlementType;
export 'src/models/sku.dart' show Sku, SkuType, SkuFlags;
export 'src/models/oauth2.dart' show OAuth2Information;

export 'src/utils/flags.dart' show Flag, Flags;
export 'src/intents.dart' show GatewayIntents;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/api_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import 'package:oauth2/oauth2.dart';
/// Options for connecting to the Discord API.
abstract class ApiOptions {
/// The version of nyxx used in [defaultUserAgent].
static const nyxxVersion = '6.1.0';
static const nyxxVersion = '6.2.0';

/// The URL to the nyxx repository used in [defaultUserAgent].
static const nyxxRepositoryUrl = 'https://github.com/nyxx-discord/nyxx';

/// The default value for the `User-Agent` header for bots made with nyxx.
static const defaultUserAgent = 'Nyxx ($nyxxRepositoryUrl, $nyxxVersion)';
static const defaultUserAgent = 'DiscordBot ($nyxxRepositoryUrl, $nyxxVersion)';

/// The host at which the API can be found.
///
Expand Down
32 changes: 28 additions & 4 deletions lib/src/builders/application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ import 'package:nyxx/src/builders/sentinels.dart';
import 'package:nyxx/src/models/application.dart';
import 'package:nyxx/src/utils/flags.dart';

class ApplicationIntegrationTypeConfigurationBuilder extends CreateBuilder<ApplicationIntegrationTypeConfiguration> {
/// Install params for each installation context's default in-app authorization link.
final InstallationParameters? oauth2InstallParameters;

ApplicationIntegrationTypeConfigurationBuilder({this.oauth2InstallParameters});

@override
Map<String, Object?> build() => {
if (oauth2InstallParameters != null)
'oauth2_install_params': {
'scopes': oauth2InstallParameters!.scopes,
'permissions': oauth2InstallParameters!.permissions.value.toString(),
},
};
}

class ApplicationUpdateBuilder extends UpdateBuilder<Application> {
Uri? customInstallUrl;

Expand All @@ -23,31 +39,39 @@ class ApplicationUpdateBuilder extends UpdateBuilder<Application> {

List<String>? tags;

Map<ApplicationIntegrationType, ApplicationIntegrationTypeConfigurationBuilder>? integrationTypesConfig;

ApplicationUpdateBuilder({
this.customInstallUrl,
this.description,
this.roleConnectionsVerificationUrl,
this.roleConnectionsVerificationUrl = sentinelUri,
this.installationParameters,
this.flags,
this.icon = sentinelImageBuilder,
this.coverImage = sentinelImageBuilder,
this.interactionsEndpointUrl,
this.interactionsEndpointUrl = sentinelUri,
this.tags,
this.integrationTypesConfig,
});

@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 (!identical(roleConnectionsVerificationUrl, sentinelUri)) 'role_connections_verification_url': roleConnectionsVerificationUrl?.toString(),
if (installationParameters != null)
'install_params': {
'scopes': installationParameters!.scopes,
'permissions': installationParameters!.permissions.toString(),
'permissions': installationParameters!.permissions.value.toString(),
},
if (integrationTypesConfig != null)
'integration_types_config': {
for (final MapEntry(:key, :value) in integrationTypesConfig!.entries) key.value.toString(): value.build(),
},
if (flags != null) 'flags': flags!.value,
if (!identical(icon, sentinelImageBuilder)) 'icon': icon?.buildDataString(),
if (!identical(coverImage, sentinelImageBuilder)) 'cover_image': coverImage?.buildDataString(),
if (!identical(interactionsEndpointUrl, sentinelUri)) 'interactions_endpoint_url': interactionsEndpointUrl?.toString(),
if (tags != null) 'tags': tags,
};
}
38 changes: 38 additions & 0 deletions lib/src/builders/application_command.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import 'package:nyxx/src/builders/builder.dart';
import 'package:nyxx/src/builders/sentinels.dart';
import 'package:nyxx/src/models/application.dart';
import 'package:nyxx/src/models/channel/channel.dart';
import 'package:nyxx/src/models/commands/application_command.dart';
import 'package:nyxx/src/models/commands/application_command_option.dart';
import 'package:nyxx/src/models/interaction.dart';
import 'package:nyxx/src/models/locale.dart';
import 'package:nyxx/src/models/permissions.dart';
import 'package:nyxx/src/utils/flags.dart';
Expand All @@ -20,12 +22,19 @@ class ApplicationCommandBuilder extends CreateBuilder<ApplicationCommand> {

Flags<Permissions>? defaultMemberPermissions;

@Deprecated('Use `contexts`')
bool? hasDmPermission;

ApplicationCommandType type;

bool? isNsfw;

/// Installation context(s) where the command is available, only for globally-scoped commands. Defaults to [ApplicationIntegrationType.guildInstall].
List<ApplicationIntegrationType>? integrationTypes;

/// Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included.
List<InteractionContextType>? contexts;

ApplicationCommandBuilder({
required this.name,
required this.type,
Expand All @@ -36,6 +45,8 @@ class ApplicationCommandBuilder extends CreateBuilder<ApplicationCommand> {
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
});

ApplicationCommandBuilder.chatInput({
Expand All @@ -47,6 +58,8 @@ class ApplicationCommandBuilder extends CreateBuilder<ApplicationCommand> {
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
}) : type = ApplicationCommandType.chatInput;

ApplicationCommandBuilder.message({
Expand All @@ -55,6 +68,8 @@ class ApplicationCommandBuilder extends CreateBuilder<ApplicationCommand> {
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
}) : type = ApplicationCommandType.message,
description = null,
descriptionLocalizations = null,
Expand All @@ -66,6 +81,8 @@ class ApplicationCommandBuilder extends CreateBuilder<ApplicationCommand> {
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
}) : type = ApplicationCommandType.user,
description = null,
descriptionLocalizations = null,
Expand All @@ -80,9 +97,12 @@ class ApplicationCommandBuilder extends CreateBuilder<ApplicationCommand> {
'description_localizations': {for (final MapEntry(:key, :value) in descriptionLocalizations!.entries) key.identifier: value},
if (options != null) 'options': options!.map((e) => e.build()).toList(),
if (defaultMemberPermissions != null) 'default_member_permissions': defaultMemberPermissions!.value.toString(),
// ignore: deprecated_member_use_from_same_package
if (hasDmPermission != null) 'dm_permission': hasDmPermission,
'type': type.value,
if (isNsfw != null) 'nsfw': isNsfw,
if (integrationTypes != null) 'integration_types': integrationTypes!.map((type) => type.value).toList(),
if (contexts != null) 'contexts': contexts!.map((type) => type.value).toList(),
};
}

Expand All @@ -99,10 +119,17 @@ class ApplicationCommandUpdateBuilder extends UpdateBuilder<ApplicationCommand>

Flags<Permissions>? defaultMemberPermissions;

@Deprecated('Use `contexts`')
bool? hasDmPermission;

bool? isNsfw;

/// Installation context(s) where the command is available, only for globally-scoped commands. Defaults to [ApplicationIntegrationType.guildInstall].
List<ApplicationIntegrationType>? integrationTypes;

/// Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included.
List<InteractionContextType>? contexts;

ApplicationCommandUpdateBuilder({
this.name,
this.nameLocalizations = sentinelMap,
Expand All @@ -112,6 +139,8 @@ class ApplicationCommandUpdateBuilder extends UpdateBuilder<ApplicationCommand>
this.defaultMemberPermissions = sentinelFlags,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
});

ApplicationCommandUpdateBuilder.chatInput({
Expand All @@ -123,6 +152,8 @@ class ApplicationCommandUpdateBuilder extends UpdateBuilder<ApplicationCommand>
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
});

ApplicationCommandUpdateBuilder.message({
Expand All @@ -131,6 +162,8 @@ class ApplicationCommandUpdateBuilder extends UpdateBuilder<ApplicationCommand>
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
}) : description = null,
descriptionLocalizations = null,
options = null;
Expand All @@ -141,6 +174,8 @@ class ApplicationCommandUpdateBuilder extends UpdateBuilder<ApplicationCommand>
this.defaultMemberPermissions,
this.hasDmPermission,
this.isNsfw,
this.integrationTypes,
this.contexts,
}) : description = null,
descriptionLocalizations = null,
options = null;
Expand All @@ -154,8 +189,11 @@ class ApplicationCommandUpdateBuilder extends UpdateBuilder<ApplicationCommand>
'description_localizations': descriptionLocalizations?.map((key, value) => MapEntry(key.toString(), value)),
if (options != null) 'options': options!.map((e) => e.build()).toList(),
if (!identical(defaultMemberPermissions, sentinelFlags)) 'default_member_permissions': defaultMemberPermissions?.value.toString(),
// ignore: deprecated_member_use_from_same_package
if (hasDmPermission != null) 'dm_permission': hasDmPermission,
if (isNsfw != null) 'nsfw': isNsfw,
if (integrationTypes != null) 'integration_types': integrationTypes!.map((type) => type.value).toList(),
if (contexts != null) 'contexts': contexts!.map((type) => type.value).toList(),
};
}

Expand Down
Loading
Loading