[英]Is there any way to get the ID of a Trello card upon creating it using JavaScript?
所以,我正在制作一個帶有集成 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。
設法找到了! 為此,請使用以下命令:
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); Response 查找卡片中的所有信息,而 .id 指定從響應中獲取什么。希望這對其他人有幫助,也對我有幫助。我建議使用console.log(response)
以查看創建卡片時可以獲得哪些其他內容。:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.