使用JavaScript创建Trello卡时,是否可以获取ID?

所以,我要制造一个集成了Trello板的Discord Bot。我的目的是让机器人添加一张卡,然后用卡的ID进行响应。我发现Trello.card.getId(),但看似是另一种语言,并返回getId()不是函数。

创建功能的完整代码:

Trello.card.create(data).then(function(response){
    console.log('Trello card has been added!');
    msg.reply('Trello card has been successfully added!');
    console.log("Card ID:"+Trello.card.getId())
  }).catch(function(error){
    console.log('Error: ',error)
  });

使用JavaScript。

gwfcdc 回答:使用JavaScript创建Trello卡时,是否可以获取ID?

设法找到它!为此,请使用以下命令:

    console.log('Trello card has been added!');
    msg.reply('Trello card has been successfully added!');
    msg.reply(response.id);
    console.log(response);
  }).catch(function(error){
    console.log('Error: ',error)
  });

具体来说,请注意“ msg.reply(response.id); 响应在卡中找到所有信息,.id指定从响应中获取什么。希望这对其他所有人都有所帮助。建议您使用console.log(response)来查看创建卡后还能得到的其他东西。 :)

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

大家都在问