SendToSlack
function SendToSlack(AWebHookURL, AMsg, AChannel, ABotName: string): boolean;
This function sends a message to a Slack channel, using a Slack web-hook, and impersonating a Slack bot.
Parameters
aWebHookURL |
Your Slack WebHook URL (to create this special URL refer to Slack official documentation) |
aMsg |
The message to be posted to your Slack channel |
aChannel |
The Slack channel you want to post your message to |
aBotName |
The Slack bot name you want to use to post the message (refer to Slack documentation) |
Return value
True |
The message was successfully posted to Slack |
False |
Error while posting the message; the message was not posted |
Example
// The following example posts a message to a Slack channel via a WebHook
begin
SendToSlack('https://hooks.slack.com/services/T00000/B00000/XXXXXXXXXXXXX', 'Some notification', '#somechannel', 'MyBot');
end.