Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.65 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. package WTPABot;
  4. use base 'Bot::BasicBot';
  5.  
  6. use Net::Twitter;
  7.  
  8. my $t = Net::Twitter->new(
  9.         traits => [qw/API::REST/],
  10.         username => "theparty",
  11.         password => "password"
  12. );
  13.  
  14. sub topic {
  15.         my $self = shift;
  16.         my $msg = shift;
  17.  
  18.         if ( $msg->{topic} ne "" ) {
  19.                 $t->update( $msg->{topic} );
  20.                 print STDERR "TOPIC: " . $msg->{topic} . "\n";
  21.         }
  22. }
  23.  
  24. package main;
  25.  
  26. my $bot = WTPABot->new(
  27.         server => "irc.easymac.org",
  28.         channels => ["#really"],
  29.         nick => "wtpa",
  30.         username => "wtpa",
  31.         name => "Party Time"
  32. );
  33.  
  34. $bot->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement