如何根据位置获取特雷洛卡

问题描述 投票:0回答:1

我正在尝试在列表中获得最高的Trello卡,但不确定如何根据位置从列表中获取卡。有任何想法吗?另外,我已经非常了解Trello api,我根本无法弄清楚。

到目前为止,我已经有了这个,但是我不知道如何获得最高的卡片。

let listID = "5ec3fda8a26c384e44f063bb";

trello.getCardsOnListWithExtraParams(listID, "pos:top",
  function(error, trelloCard) {
    if (error) {
      console.log('An error occured with Trello card.' + error)
      message.channel.send({
        embed: {
          color: 0xff604d,
          description: "An error occured! Please try again later or use the support server link."
        }
      });
    } else {
      console.log('Found card:', trelloCard);
    }
  });
javascript trello
1个回答
1
投票

[当我使用您的代码并将[0]添加到它记录的trelloCard时,它可以正常工作并获得列表中的第一个。

trello.getCardsOnListWithExtraParams(listID, "pos:top",
      function (error, trelloCard) {
          if (error) {
              console.log('An error occured with Trello card.' + error)
           //testing this in console so I removed the message.channel.send
          }
          else {
              console.log('Found card:', trelloCard[0]);
          }
        })

输出:

...
name: 'two',
pos: 0.5,
...

第一个]

trello screenshot

© www.soinside.com 2019 - 2024. All rights reserved.