nyxx.interactions pubspec changes & improvements

This commit is contained in:
HarryET 2021-02-10 18:35:17 +00:00 committed by Szymon Uglis
parent d59ec1ed07
commit 102650c81c
No known key found for this signature in database
GPG key ID: 112376C5BEE91FE2
3 changed files with 6 additions and 17 deletions

View file

@ -55,13 +55,8 @@ class Interactions {
if (!registeredOnly) {
return _commands;
}
final registeredCommands = List<SlashCommand>.empty(growable: true);
for (final command in _commands) {
if (command.isRegistered) {
registeredCommands.add(command);
}
}
return registeredCommands;
return _commands.where((command) => command.isRegistered).toList();
}
/// Syncs the local commands with the discord API

View file

@ -12,9 +12,9 @@ class InteractionEvent {
InteractionEvent._new(Nyxx client, Map<String, dynamic> rawJson) {
this._client = client;
interaction = Interaction._new(client, rawJson);
this.interaction = Interaction._new(client, rawJson);
if (interaction.type == 1) {
if (this.interaction.type == 1) {
this._pong();
}
}

View file

@ -1,5 +1,5 @@
name: nyxx_interactions
version: 1.1.0-dev.2
version: 1.1.0-dev.1
authors:
- HarryET
description: Interactions for Nyxx library
@ -9,18 +9,12 @@ documentation: https://github.com/l7ssha/nyxx/wiki
issue_tracker: https://github.com/l7ssha/nyxx/issue
environment:
sdk: '>=2.12.0-51.0.dev <3.0.0'
sdk: ">=2.12.0-51.0.dev <3.0.0"
dependencies:
logging: "^1.0.0-nullsafety.0"
nyxx: "^1.1.0-dev.2"
dependency_overrides:
http:
git:
url: git://github.com/dart-lang/http.git
http_parser:
git:
url: git://github.com/dart-lang/http_parser.git
nyxx:
path: "../nyxx"