Example: Sending text messages to Slack

stable
By Stephan in Miscellaneous Published October 2020 👁 1,373 views 💬 0 comments

Description

This is an example script to show how to send text messages to external sources like (in this case) Slack. Please note: This script only works in Version 4 of the Haasbot, version 3 does not have support for this.
HaasScript
p = ClosePrices(1);

-- Make some sort of logic to trigger it
if (p[1] > 100000) then

  -- Please visit the following website listed to see how you can 
  -- get the Slack webhook: https://api.slack.com/messaging/webhooks  
  BroadcastToSlack('https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX',
  '#MyTopic',
  '#HaasScriptBot',
  'This is a message send directly from HaasScript')

end

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!