use Google::Chat::WebHooks; my $room = Google::Chat::WebHooks->new(room_webhook_url => 'https://chat.googleapis.com/v1/spaces/someid/messages?key=something&token=something'); my $result = $room->simple_text("This is a message"); $result = $room->simple_text("Message with some *bold*");
Google::Chat::WebHooks - Send notifications to Google Chat Rooms as provided by G-Suite. Does not work with Google Hangouts as used with your free Google account. Cannot receive messages - for that you need a bot. I'm sure I'll write that module some day.
Just create an object, passing the webhook URL of the room to which you want to send notifications. Then fire away. If you need help setting up a webhook for your room, see https://developers.google.com/hangouts/chat/how-tos/webhooks.
Create a new instance of this class, passing in the webhook URL to send messages to. This argument is mandatory. Failure to set it upon creation will result in the method croaking.
Optionally also set the connect timeout in seconds. Default value is 10.
my $result = $room->simple_text("This is a message"); $result->{'result'}; # 1 if success, 0 if not $result->{'message'}; # "success" if result was 1, error message if not
Send a message to the room. Basic formatting is available. Returns a hash ref.
Get/set the URL of the room.
Please log them on GitHub.
I Gibbs CPAN ID: IGIBBS igibbs@cpan.org https://github.com/realflash/perl-google-chat-webhoooks
This program is free software licensed under the...
The General Public License (GPL) Version 3
The full text of the license can be found in the LICENSE file included with this module.
To install Google::Chat::WebHooks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Chat::WebHooks
CPAN shell
perl -MCPAN -e shell install Google::Chat::WebHooks
For more information on module installation, please visit the detailed CPAN module installation guide.