Created
November 22, 2021 13:46
-
-
Save kiriu-j/d8c369a071669fb4bc2c775edb1e2914 to your computer and use it in GitHub Desktop.
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
import os | |
from slack_sdk import WebClient | |
from slack_sdk.errors import SlackApiError | |
slack_token = os.environ["SLACK_BOT_TOKEN"] | |
client = WebClient(token=slack_token) | |
try: | |
response = client.chat_postMessage( | |
channel="channel name", | |
text="Hello from your app! :tada:", | |
) | |
except SlackApiError as e: | |
assert e.response["error"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment