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 command in the Slack Command Tree you've created in Step 2.1.
What is your Result?
note
Please remember to connect your Slack Channel on Stella before testing for the result.
Sample Tree Structure for Archive Function
You can click here to download the sample tree.
Getting Hands-on
Enter your Bot Builder and starting building 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:
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.
tip
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.