move static method

Implementation

static Future<String> move(CommandContext ctx) async {
  if (ctx.args.length < 2) {
    return '❌ Usage: !move <from> <to>';
  }

  final from = int.tryParse(ctx.args[0]);
  final to = int.tryParse(ctx.args[1]);

  if (from == null || to == null || from < 1 || to < 1) {
    return '❌ Invalid track numbers!';
  }

  final manager = ctx.client.getPlayerManager(ctx.guildId);
  if (manager == null) {
    return '❌ No player active!';
  }

  final track = manager.moveInQueue(from - 1, to - 1);
  if (track == null) {
    return '❌ Failed to move track!';
  }

  return '✅ Moved: **${track.info.title}** to position $to';
}