App-RoboBot
view release on metacpan or search on metacpan
lib/App/RoboBot/Plugin/Bot/ChannelLink.pm view on Meta::CPAN
package App::RoboBot::Plugin::Bot::ChannelLink;
$App::RoboBot::Plugin::Bot::ChannelLink::VERSION = '4.004';
use v5.20;
use namespace::autoclean;
use Moose;
use MooseX::SetOnce;
use Data::Dumper;
use App::RoboBot::Channel;
use App::RoboBot::Response;
extends 'App::RoboBot::Plugin';
=head1 bot.channellink
Allows for echoing messages across different channels, even across networks.
Linked channels require the bot to exist in both. Messages sent by users of one
channel will be echoed to the other by the bot. When possible (network features
permitting), the names of the original senders will be included in the echoed
output.
The linked channels do not need to be on the same network, but they must be
connected to by the same instance of the bot.
=cut
has '+name' => (
default => 'Bot::ChannelLink',
);
has '+description' => (
default => 'Allows for echoing messages across different channels, even across networks.',
);
has '+before_hook' => (
default => 'echo_incoming',
);
has '+after_hook' => (
default => 'echo_outgoing',
);
=head2 link-channels
=head3 Description
Links the current channel with the named channel, so that all messages
appearing in one are echoed to the other.
The link needs to be created only in one of the channels, as all links are
bi-directional. Echoed messages will be sent by the bot, but will be prefaced
with the string "<$network/$nick>" to indicate the original speaker and their
location. The channel name will assume a leading ``#`` in the event you do not
provide one (you cannot link one channel with a direct message).
For a list of networks and channels, refer to ``(network-list)`` and
``(channel-list)``, respectively.
=head3 Usage
<network> <channel>
( run in 2.149 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )