// Menu: Basecamp - Create Task
// Description: Create a Basecamp task
let { me, selectTodoList, createTodo } = await lib("basecamp")
let list = await selectTodoList()
setHint(`${list.bucket.name} - ${list.title}`)
let title = await arg('Task name:')
let today = new Date()
let dd = String(today.getDate()).padStart(2, '0')
let mm = String(today.getMonth() + 1).padStart(2, '0')
let yyyy = today.getFullYear()
let response = await createTodo({
content: title,
assignee_ids: [me.id],
due_on: `${yyyy}-${mm}-${dd}`
}, list.bucket.id, list.id)
setHint(`${title} Created!`)
wait(2000)