Create Archive Function
Each live chat enquiry is displayed as a private channel on your Slack. If you have hundreds of channels flowing in everyday, then archiving will be a very useful function to keep your channel list tidy and clean.
Please set up this function in the Slack Command Tree you've created in 2.1.
What is your Result?
- Please remember to connect your Slack Channel on Stella before testing for the result.
Sample Tree Structure for Archive Function
Slack Command Tree Structure for Archive Function
here to download the sample tree.
You can clickGetting Hands-on
Click here to build your tree.
Create a Tree Node - Select Archive
- Create a tree node and name it as "Select Archive". Then, create a pre-action for the archive function with the following code:
return new Promise(async (resolve, reject) => {
try {
await this.slackArchiveConversation({
messageEvent: this.messageEvent,
channel: this.channel
})
resolve()
} catch (e) {
reject(e)
}
})
Create a Global Node - Select Archive
- Create a global node and name it as "Select Archive Global". Then, create a trigger with two conditions with the and operator:
Archive Button Trigger for Slack
First condition - Type Payload:
this.messageEvent.type === "PAYLOAD"
Second condition - ARCHIVE:
this.lodash.get(this.messageEvent, "data.payload") === "ARCHIVE"
- Toggle Redirect to the tree node you created for archiving.
Redirect to Slack Archive Tree Node
Before testing, please remember to update the tree and global node in the Slack Channel.
- Check and see if you can produce the expected outcome.