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

215
Views
holgura obtener el nombre del remitente del mensaje para los mensajes devueltos de la API de conversación.historia

Llamo a la API de Slack (conversations.history) para recibir mensajes del canal. Quiero recuperar el nombre del remitente en la respuesta del mensaje. ¿Cómo puedo obtenerlo?

a continuación está mi mensaje de respuesta:

 { "client_msg_id": "0e19ca7d-1072-4f73-a932-9ec7fa9956de", "type": "message", "text": "Yeah good edge case, I would agree, just mentioning \" no data found\"", "user": "U01JW9D10PQ", "ts": "1642216920.001100", "team": "T01K38V9Q7M", blocks:[]}
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puede usar la identificación de usuario devuelta por la clave de user para realizar una llamada a users.info después de recibir esa carga útil.

over 4 years ago · Santiago Trujillo Report

0

La API de chats.history no devuelve la información del usuario (solo la identificación del usuario), es posible que debas obtener a cada usuario del historial del canal , mira un código de ejemplo:

Obtener usuarios del historial de canales de Slack Ejecutar en Fusebit
 const channelId = 'C02TSNCQ2Q2'; const channelHistory = await client.conversations.history({ channel: channelId, }); // Get the user ids from the history and populate an array with the user details const userList = []; for await (let message of channelHistory.messages) { const userAdded = userList.find(user => user.id === message.user); if (!userAdded) { const response = await slackClient.users.info({ user: message.user, }); if (response.ok) { const { id, name, real_name, profile, is_bot } = response.user; userList.push({ id, name, real_name, profile, is_bot }); } } } console.log(`There are ${userList.length} users in the channel conversation:\n${userList.map(user => `${(user.is_bot ? '🤖' : '👤')} ${user.name}`).join('\n')}`);
over 4 years ago · Santiago Trujillo Report
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!