Slack is one of the leading communication platforms for millions of users. With it, you can perform instant messaging, document sharing, and a variety of other activities to improve the collaboration between team members. You can also automate or control many things with Bots in Slack by using IDE Software.
Can you create Slack Bots using Delphi?
Yes you can!
SDriver is a Delphi wrapper for Slack API by Andrea Magni who is one of the Embarcadero MVPs. SDriver is a free and open-source wrapper for Delphi developers.
The best thing is that the wrapper utilizes the native HTTP client libraries for each supported platform – System.Net.HttpClient. And also implemented with System. Threading library to work asynchronously.
What are the features of SDriver?
- Compatible with FireMonkey, Visual Component Library, and also Non-visual components
- Support for Message Attachments
- Support for Incoming Webhooks
- Implemented using Native HTTP Client Libraries
- Async implementation using Parallel Programming Library
What are “Incoming Webhooks” in Slack?
Incoming Webhooks are a simple way to post messages from apps into Slack. By creating an Incoming Webhooks you get a unique URL which you can send a JSON payload with the message text and some options.
"text": "Hello, world."
, SDriver.Message, SDriver.Interfaces, SDriver.IncomingWebHook;
procedure TForm1.SendActionExecute(Sender: TObject);
LStopWatch := TStopWatch.StartNew;
LMessage := TMessage.Create(EditMessage.Text + ' [' + TimeToStr(Now) + ']');
LMessage.UserName := EditUserName.Text;
LMessage.Icon_URL := EditIcon_URL.Text;
LMessage.Icon_Emoji := EditIcon_Emoji.Text;
LMessage.Channel := EditChannel.Text;
LWebHook := TIncomingWebHook.Create(EditWebHookURL.Text, False);
procedure TForm1.SendActionUpdate(Sender: TObject);
SendAction.Enabled := (EditWebHookURL.Text <> '') and (EditMessage.Text <> '');