MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getThreadReplies

Function getThreadReplies

server/src/slack/client.ts:935–973  ·  view source on GitHub ↗
(
  channelId: string,
  threadTs: string
)

Source from the content-addressed store, hash-verified

933 * Returns all messages in a thread, including the parent message
934 */
935export async function getThreadReplies(
936 channelId: string,
937 threadTs: string
938): Promise<SlackThreadMessage[]> {
939 if (!SLACK_BOT_TOKEN) {
940 throw new Error('ADDIE_BOT_TOKEN is not configured');
941 }
942
943 try {
944 const url = new URL(`${SLACK_API_BASE}/conversations.replies`);
945 url.searchParams.set('channel', channelId);
946 url.searchParams.set('ts', threadTs);
947 url.searchParams.set('limit', '100'); // Get up to 100 messages in thread
948
949 const response = await fetch(url.toString(), {
950 method: 'GET',
951 headers: {
952 Authorization: `Bearer ${SLACK_BOT_TOKEN}`,
953 'Content-Type': 'application/x-www-form-urlencoded',
954 },
955 });
956
957 const data = await response.json() as {
958 ok: boolean;
959 messages?: SlackThreadMessage[];
960 error?: string;
961 };
962
963 if (!data.ok) {
964 logger.warn({ error: data.error, channelId, threadTs }, 'Failed to get thread replies');
965 return [];
966 }
967
968 return data.messages || [];
969 } catch (error) {
970 logger.error({ error, channelId, threadTs }, 'Error fetching thread replies');
971 return [];
972 }
973}
974
975/**
976 * Open a group DM (multi-person direct message) with multiple users

Callers 8

shouldRespondAfterDelayFunction · 0.85
handleAppMentionFunction · 0.85
handleChannelMessageFunction · 0.85
runSlackHistoryBackfillFunction · 0.85
runShadowEvaluatorJobFunction · 0.85
backfillFunction · 0.85
getActiveThreadsFunction · 0.85

Calls 2

warnMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected