Skip to content

Commit

Permalink
Tweak slack sample (#1847)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace Nassri authored and engelke committed Nov 20, 2018
1 parent fc3284d commit a48c010
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions functions/billing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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]


Expand Down

0 comments on commit a48c010

Please sign in to comment.