Skip to content

Commit

Permalink
Merge pull request schmooky#15 from dvasiliev97/fix/player/move
Browse files Browse the repository at this point in the history
fix: fix move command
  • Loading branch information
devianllert authored Aug 30, 2019
2 parents 87b7a05 + 4dc4762 commit aad5b90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/BotMediaPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ class MediaPlayer {
const max = this.queue.length - 1;
const min = 0;

const from = Math.min(Math.max(currentIdx, min), max);
const to = Math.min(Math.max(targetIdx, min), max);
const from = Math.min(Math.max(currentIdx - 1, min), max);
const to = Math.min(Math.max(targetIdx - 1, min), max);

this.queue.move(from, to);
}
Expand Down
4 changes: 4 additions & 0 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const logger = winston.createLogger({
),
handleExceptions: true,
}),
new winston.transports.File({ filename: './log/warn.log', level: 'warn' }),
new winston.transports.File({ filename: './log/error.log', level: 'error' }),
new winston.transports.File({ filename: './log/fatal.log', level: 'fatal' }),
new winston.transports.File({ filename: './log/combined.log' }),
],
});

Expand Down

0 comments on commit aad5b90

Please sign in to comment.