WebService::Slack::IncomingWebHook - slack incoming webhook client
# for perl program
use WebService::Slack::IncomingWebHook;
my $client = WebService::Slack::IncomingWebHook->new(
webhook_url => 'http://xxxxxxxxxxxxxx',
);
$client->post(
text => 'yahoooooo!!',
);
# for cli
% post-slack --webhook_url='https://xxxxxx' --text='yahooo'
WebService::Slack::IncomingWebHook is slack incoming webhooks client. Slack is chat web service. For cli, this distribution provides post-slack command.
-
WebService::Slack::IncomingWebHook->new(%params)
my $client = WebService::Slack::IncomingWebHook->new( webhook_url => 'http://xxxxxxxxxxxxxx', # required channel => '#general', # optional username => 'masasuzu', # optional icon_emoji => ':sushi:', # optional icon_url => 'http://xxxxx/xxx.jpeg', # optional );
Creates new object.
-
$client->post(%params)
$client->post( text => 'yahoooooo!!', channel => '#general', username => 'masasuzu', icon_emoji => ':sushi:', icon_url => 'http://xxxxx/xxx.jpeg', );
Posts to slack incoming webhooks. channel, username, icon_emoji and icon_url parameters can override constructor's parameter.
text, pretext, color, fields and attachments parameter are available. See also slack incoming webhook document.
% post-slack --webhook_url='https://xxxxxx' --text='yahooo'
available options are ...
- --webhook_url (required)
- --text (required)
- --channel (optional)
- --username (optional)
- --icon_url (optional)
- --icon_emoji (optional)
https://my.slack.com/services/new/incoming-webhook
Copyright (C) SUZUKI Masashi.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SUZUKI Masashi [email protected]