PrePAN

Sign in to PrePAN

Mojo-SlackRTM SlackRTM client using Mojo::IOLoop

Good

Synopsis

use Mojo::SlackRTM;

my $slack = Mojo::SlackRTM->new(token => "your_token");
$slack->on(message => sub {
  my ($slack, $event) = @_;
  my $channel_id = $event->{channel};
  my $user_id    = $event->{user};
  my $user_name  = $slack->find_user_name($user_id);
  my $text       = $event->{text};
  $slack->send_message($channel_id => "hello $user_name!");
});
$slack->start;

Description

Mojo::SlackRTM is a SlackRTM client using Mojo::IOLoop.

Please look at https://github.com/skaji/Mojo-SlackRTM for details.

See also

Question

  • Can I use Mojo namespace?
  • If not, what name do you recommend?

Comments

Please sign up to post a review.