From a48c010481c166968d9f1bd58106054c5d1c58f9 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Tue, 20 Nov 2018 15:25:21 -0800 Subject: [PATCH] Tweak slack sample (#1847) --- functions/billing/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/functions/billing/main.py b/functions/billing/main.py index abeabf54e4a7..ceb2e6f9297a 100644 --- a/functions/billing/main.py +++ b/functions/billing/main.py @@ -44,7 +44,7 @@ # See https://api.slack.com/docs/token-types#bot for more info BOT_ACCESS_TOKEN = 'xxxx-111111111111-abcdefghidklmnopq' -CHANNEL = 'general' +CHANNEL_ID = 'C0XXXXXX' slack_client = SlackClient(BOT_ACCESS_TOKEN) @@ -56,11 +56,10 @@ def notify_slack(data, context): notification_data = base64.b64decode(data['data']).decode('utf-8') budget_notification_text = f'{notification_attrs}, {notification_data}' - res = slack_client.api_call( + slack_client.api_call( 'chat.postMessage', - channel=CHANNEL, + channel=CHANNEL_ID, text=budget_notification_text) - print(res) # [END functions_billing_slack]