Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4618 from kishanprmr/slack-react-message
feat(slack): add reaction to message action
- Loading branch information
Showing
6 changed files
with
210 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"name": "@activepieces/piece-slack", | ||
"version": "0.5.7" | ||
"version": "0.5.8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/pieces/community/slack/src/lib/actions/add-reaction-to-message.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { slackAuth } from '../../'; | ||
import { createAction, Property } from '@activepieces/pieces-framework'; | ||
import { slackChannel, slackInfo } from '../common/props'; | ||
|
||
import { WebClient } from '@slack/web-api'; | ||
|
||
export const addRectionToMessageAction = createAction({ | ||
auth: slackAuth, | ||
name: 'slack-add-reaction-to-message', | ||
displayName: 'Add Reaction to Message', | ||
description: 'Add an emoji reaction to a message.', | ||
|
||
props: { | ||
info: slackInfo, | ||
channel: slackChannel, | ||
ts: Property.ShortText({ | ||
displayName: 'Message ts', | ||
description: | ||
'Provide the ts (timestamp) value of the message to update, e.g. `1710304378.475129`.', | ||
required: true, | ||
}), | ||
reaction: Property.ShortText({ | ||
displayName: 'Reaction (emoji) name', | ||
required: true, | ||
description: 'e.g.`thumbsup`', | ||
}), | ||
}, | ||
|
||
async run(context) { | ||
const { channel, ts, reaction } = context.propsValue; | ||
|
||
const slack = new WebClient(context.auth.access_token); | ||
|
||
const response = await slack.reactions.add({ | ||
channel, | ||
timestamp: ts, | ||
name: reaction, | ||
}); | ||
|
||
return response; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters