Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+ Auto::Notify {
- # mask: *@*
- # keyword: foo,bar,baz
- # blocks: notifo
- # notifo {
- # type: notifo
- # api-key: yourapikey
- # user: yourusername
- # format: #(nick.now): #(text)
- # }
- #}
- sub config_notifo {
- my ($this, $config) = @_;
- 1;
- }
- sub send_notifo {
- my ($this, $config, $text, $msg, $sender, $full_ch_name) = @_;
- require WebService::Notifo;
- $text = Auto::AliasDB->stdreplace(
- $msg->prefix,
- $config->format || $this->config->format || '[tiarra][#(channel):#(nick.now)] #(text)',
- $msg, $sender,
- channel => $full_ch_name,
- raw_channel => Auto::Utils::get_raw_ch_name($msg, 0),
- text => $this->strip_mirc_formatting($text),
- );
- WebService::Notifo->new(
- api_key => $config->api_key,
- user => $config->user,
- )->send_notification(
- title => 'Keyword found',
- label => 'Tiarra',
- msg => Tiarra::Encoding->new($text, 'jis')->utf8,
- );
- }
Add Comment
Please, Sign In to add comment