MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / postMessage

Method postMessage

integrations/slack/src/index.ts:111–149  ·  view source on GitHub ↗
(
    key: IntegrationTaskKey,
    params: ChatPostMessageArguments
  )

Source from the content-addressed store, hash-verified

109 }
110
111 postMessage(
112 key: IntegrationTaskKey,
113 params: ChatPostMessageArguments
114 ): Promise<ChatPostMessageResponse> {
115 return this.runTask(
116 key,
117 async (client) => {
118 try {
119 return client.chat.postMessage(params);
120 } catch (error) {
121 if (isPlatformError(error)) {
122 if (error.data.error === "not_in_channel") {
123 const joinResponse = await this.joinConversation(`Join ${params.channel}`, {
124 channel: params.channel,
125 });
126
127 if (joinResponse.ok) {
128 return client.chat.postMessage(params);
129 }
130 }
131 }
132
133 throw error;
134 }
135 },
136 {
137 name: "Post Message",
138 params,
139 icon: "slack",
140 properties: [
141 {
142 label: "Channel ID",
143 text: params.channel,
144 },
145 ...(params.text ? [{ label: "Message", text: params.text }] : []),
146 ],
147 }
148 );
149 }
150
151 joinConversation(
152 key: IntegrationTaskKey,

Callers 4

#postSlackMessageMethod · 0.80
slack.tsFile · 0.80
github.tsFile · 0.80
byo-auth.tsFile · 0.80

Calls 3

runTaskMethod · 0.95
joinConversationMethod · 0.95
isPlatformErrorFunction · 0.85

Tested by

no test coverage detected