AnyEvent-Mattermost
view release on metacpan or search on metacpan
lib/AnyEvent/Mattermost.pm view on Meta::CPAN
the raw message data received over the Mattermost WebSockets connection. This
message payload will take different forms depending on the type of event which
occurred, but the top-level data structure is always a hash reference with at
least the key C<event> (with a value matching that which you used to register
the callback). Most event types include a C<data> key, whose value is a hash
reference containing the payload of the event. For channel messages this will
include things like the sender's name, the channel name and type, and of course
the message itself.
For more explanation of event types, hope that the Mattermost project documents
them at some point. For now, L<Data::Dumper> based callbacks are your best bet.
=cut
sub on {
my ($self, %registrations) = @_;
foreach my $type (keys %registrations) {
my $cb = $registrations{$type};
$self->{'registry'}{$type} = $cb;
}
( run in 0.227 second using v1.01-cache-2.11-cpan-4d50c553e7e )