Fixup command registration logic

This commit is contained in:
Szymon Uglis 2021-02-11 15:31:50 +01:00
parent fb6a44be1d
commit 78b0cf2863
No known key found for this signature in database
GPG key ID: 112376C5BEE91FE2

View file

@ -65,15 +65,12 @@ class Interactions {
var failed = 0;
for (final command in _commands) {
if (!command.isRegistered) {
await command
._register()
.catchError(() {
failed++;
return;
});
this._events.onSlashCommandCreated.add(command);
success++;
await command._register().then((value) {
this._events.onSlashCommandCreated.add(command);
success++;
}).catchError(() {
failed++;
});
}
}
_logger.info(