| 1 | package API::Matterbridge::Message; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Moo 2; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use JSON 'decode_json'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use Filter::signatures; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use feature 'signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | no warnings 'experimental::signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | our $VERSION = '0.02'; | |
| 12 | |||
| 13 | # This is just a hash-with-(currently no)-methods | ||
| 14 | |||
| 15 | 1 | has [ | |
| 16 | "text", | ||
| 17 | "channel", | ||
| 18 | "username", | ||
| 19 | "userid", | ||
| 20 | "avatar", | ||
| 21 | "account", | ||
| 22 | "event", | ||
| 23 | "protocol", | ||
| 24 | "gateway", | ||
| 25 | "parent_id", | ||
| 26 | "timestamp", | ||
| 27 | "id", | ||
| 28 | "Extra", | ||
| 29 | ] => ( | ||
| 30 | is => 'ro', | ||
| 31 | ); | ||
| 32 | |||
| 33 | 0 | ▶ | sub from_bytes( $class, $bytes ) { |
|
Subroutine
from_bytes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 34 | 0 | return $class->new( decode_json($bytes)) | |
| 35 | } | ||
| 36 | |||
| 37 | 0 | ▶ | sub reply( $msg, $text, %options ) { |
|
Subroutine
reply: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 38 | 0 | my %reply = ( | |
| 39 | gateway => $msg->gateway, | ||
| 40 | text => $text, | ||
| 41 | %options | ||
| 42 | ); | ||
| 43 | 0 | return (ref $msg)->new(\%reply) | |
| 44 | } | ||
| 45 | |||
| 46 | 1 | 1; | |
| 47 | |||
| 48 | |||
| 49 | =head1 REPOSITORY | ||
| 50 | |||
| 51 | The public repository of this module is | ||
| 52 | L<https://github.com/Corion/Mojolicious-Matterbridge>. | ||
| 53 | |||
| 54 | =head1 SUPPORT | ||
| 55 | |||
| 56 | The public support forum of this module is L<https://perlmonks.org/>. | ||
| 57 | |||
| 58 | =head1 BUG TRACKER | ||
| 59 | |||
| 60 | Please report bugs in this module via the Github bug queue at | ||
| 61 | L<https://github.com/Corion/Mojolicious-Matterbridge/issues> | ||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | Max Maischein C<corion@cpan.org> | ||
| 66 | |||
| 67 | =head1 COPYRIGHT (c) | ||
| 68 | |||
| 69 | Copyright 2020 by Max Maischein C<corion@cpan.org>. | ||
| 70 | |||
| 71 | =head1 LICENSE | ||
| 72 | |||
| 73 | This module is released under the same terms as Perl itself. | ||
| 74 | |||
| 75 | =cut | ||