Slack-Notify - Trigger Slack incoming webhooks
use Slack::Notify;
my $n = Slack::Notify->new(
hook_url => 'https://hooks.slack.com/services/...',
);
$n->post(
text => "something happened",
);
This is a simple client for Slack incoming webhooks.
Create a Slack::Notify
object with the URL of an incoming hook, then call
the post
method to trigger it.
my $n = Slack::Notify->new;
This constructor returns a new Slack::Notify object. Valid arguments include:
-
hook_url
The Slack incoming hook URL. Create one of these in the Slack integrations config.
$n->post(
text => 'something happened',
Triggers the hook. There's several arguments you can supply, which are described in more detail in the incoming hook documentation.
-
text
A simple, multi-line message without special formatting.
-
username
Value to use for the username, overriding the one set in the hook config.
-
icon_url
URL of an image to use for the icon, overriding the one set in the hook config.
-
icon_emoji
An emoji code (eg
:+1:
) to use for the icon, overriding the one set in the hook config. -
channel
A channel name or user to direct to direct the message into, overriding the one set in the hook config.
-
attachments
An arrayref containing some attachment objects. See the attachment guide for details. At the moment this module supports attachment fields, but not buttons, menus and other interactive ocontent.
Please report any bugs or feature requests through the issue tracker at https://github.com/robn/Slack-Notify/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/robn/Slack-Notify
git clone https://github.com/robn/Slack-Notify.git
- Rob N ★ robn@robn.io
This software is copyright (c) 2017 by Rob N ★
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.