Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
Cómo responder a la vista después de enviar la vista en holgura con bolt js

Hola, implementé un atajo simple para obtener datos de la entrada, pero después de enviar la vista, no pude obtener la carga de respuesta o no puedo actualizar la vista para reconocer al usuario. siguiente es mi código simple.

 const { App } = require("@slack/bolt"); const app = new App({ token: process.env.BOT_TOKEN, socketMode: true, signingSecret: process.env.SIGNIGN_SECRET, appToken: process.env.APP_TOKEN, }); app.shortcut({ callback_id: 'open_modal', type: 'message_action' }, async ({ shortcut, ack, client }) => { try { await ack(); console.log("Ack:") const result = await client.views.open({ trigger_id: shortcut.trigger_id, callback_id: "new-task-modal", view: { type: "modal", title: { type: "plain_text", text: "My App", }, submit: { type: "plain_text", text: "Submit", emoji: true, }, close: { type: "plain_text", text: "Cancel", }, blocks: [ { "type": "input", "element": { "type": "plain_text_input", "action_id": "plain_text_input-action" }, "label": { "type": "plain_text", "text": "Label", "emoji": true } } ], }, }); } catch (error) { console.log(error); } }); app.view({ callback_id: 'new-task-modal', type: 'message_action' }, async({ shortcut, ack, view, body }) => { try { console.log("New task modal",view.state.values ); await ack(); let result = await client.views.update({ view_id: body.view.id, view: { type: "modal", title: { type: "plain_text", text: "My App", emoji: true, }, close: { type: "plain_text", text: "Cancel", }, blocks: [ { type: "section", text: { type: "plain_text", text: "This is a plain text section block.", emoji: true, }, }, ], } }); } catch (error) { console.log(error) } })

La función app.shortcut() funciona bien y crea una vista, pero después de enviar esa vista, no pudo acceder a la función app.view() para actualizar la vista, así que hay alguna forma de actualizar la vista actual.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!