Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Update to nyxx 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
l7ssha committed Mar 5, 2023
1 parent 46fbb01 commit 5fa352d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/events/interaction_event.dart
Expand Up @@ -195,7 +195,7 @@ abstract class InteractionEventWithAcknowledge<T extends IInteraction> extends I
} on IHttpResponseError catch (response) {
// 40060 - Interaction has already been acknowledged
// Catch in case of a desync between server and _hasAcked
if (response.code == 40060) {
if (response.errorCode == 40060) {
throw AlreadyRespondedError();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/internal/interaction_endpoints.dart
Expand Up @@ -498,7 +498,7 @@ class InteractionsEndpoints implements IInteractionsEndpoints {
} on IHttpResponseError catch (response) {
// 10066 = Unknown application command permissions
// Means there are no overrides for this command... why is this an error, Discord?
if (response.code == 10066) {
if (response.errorCode == 10066) {
_logger.finest('Got error code 10066 on permissions for command $commandId in guild $guildId, returning empty permission overrides.');
return SlashCommandPermissionOverrides.empty(commandId, _client);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/interaction.dart
Expand Up @@ -154,7 +154,7 @@ class ModalInteraction extends Interaction implements IModalInteraction {
if (raw['data']["components"] != null) {
components = [
for (final rawRow in raw['data']["components"])
[for (final componentRaw in rawRow["components"]) MessageComponent.deserialize(componentRaw as RawApiMap)]
[for (final componentRaw in rawRow["components"]) MessageComponent.deserialize(componentRaw as RawApiMap, client)]
];
} else {
components = [];
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Expand Up @@ -18,5 +18,5 @@ dev_dependencies:
test: ^1.19.0
mockito: ^5.0.16
build_runner: ^2.1.4
lints: ^1.0.1
lints: ^2.0.1
coverage: ^1.0.3
4 changes: 3 additions & 1 deletion test/unit/component_builder_test.dart
Expand Up @@ -2,6 +2,8 @@ import 'package:nyxx/nyxx.dart';
import 'package:nyxx_interactions/nyxx_interactions.dart';
import 'package:test/test.dart';

import '../mocks/nyxx_rest.mocks.dart';

main() {
test("components", () {
final customButton = ButtonBuilder("label", "customId", ButtonStyle.secondary);
Expand Down Expand Up @@ -78,7 +80,7 @@ main() {
});

test("MultiselectOptionBuilder emoji unicode", () {
final builder = MultiselectOptionBuilder("test", 'test')..emoji = IBaseGuildEmoji.fromId(Snowflake.zero());
final builder = MultiselectOptionBuilder("test", 'test')..emoji = IBaseGuildEmoji.fromId(Snowflake.zero(), NyxxRestMock());

final expectedResult = {
'label': 'test',
Expand Down

0 comments on commit 5fa352d

Please sign in to comment.