如何根据位置获取trello卡

我正在尝试在特定列表中获得顶级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);
    }
  });
a4702860 回答:如何根据位置获取trello卡

当我使用您的代码并将[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

本文链接:https://www.f2er.com/2316904.html

大家都在问