# Slack Communication Module

**Module Location:** `groclake.toollake.comm.slack`

### **Overview**

The Slack module in Toollake allows users to send messages to Slack channels using the Slack SDK. This is particularly useful for **real-time notifications, team communication, and automated status updates.**

### **Setup Requirements**

To use the Slack module, ensure you have the following:\
✅ **Slack Bot Token** (Set as an environment variable: `SLACK_BOT_TOKEN`)\
✅ Install required packages:

```sh
pip install slack-sdk python-dotenv
```

### **Class: Slack**

The `Slack` class provides an interface to send messages to Slack channels.

### **Method: send\_message(payload)**

Sends a message to a specified Slack channel.

**Parameters**

| Parameter | Type | Description                                                           |
| --------- | ---- | --------------------------------------------------------------------- |
| `payload` | dict | Dictionary containing message details                                 |
| `message` | str  | The text message to be sent                                           |
| `channel` | str  | The Slack channel where the message should be sent (e.g., `#general`) |

### **Returns**

A dictionary with a success message or an error message in case of failure.

### **Example Usage**

```python
from groclake.toollake.comm.slack import Slack

slack = Slack()
response = slack.send_message({
    "message": "Hello team!",
    "channel": "#general"
})
print(response)  # {"message": "Message Sent Successfully"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.groclake.ai/lakes/tool-management-and-gateway/toollake/slack-communication-module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
