mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
17 lines
498 B
Python
Executable File
17 lines
498 B
Python
Executable File
import os
|
|
|
|
from slack_sdk.web.client import WebClient
|
|
from slack_sdk.webhook.client import WebhookClient
|
|
|
|
client = WebClient(token=os.environ.get("G_ALL_SLACK_TOKEN"))
|
|
|
|
def main(response_url: str, text: str):
|
|
webhook = WebhookClient(response_url)
|
|
# Send a reply
|
|
webhook.send(text=f"You said '{text}'")
|
|
|
|
# Send a message to a slack channel
|
|
client.chat_postMessage(
|
|
channel="demobot",
|
|
text="{} sent the message {}".format(os.environ.get("WM_USERNAME"), text)
|
|
) |