Skip to content

Commit

Permalink
add support for "action" messages and topic changes
Browse files Browse the repository at this point in the history
also, send a message when the script is reloaded.
  • Loading branch information
knilch0r committed Oct 25, 2020
1 parent a7cce84 commit 0ca11c7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions telegram.pl
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,18 @@ sub telegram_signal_private {
return telegram_signal($server, $msg, $nick, $address, undef);
}

sub telegram_signal_action {
my ($server, $msg, $nick, $address, $target) = @_;

return telegram_signal($server, '[ACTION] '.$msg, $nick, $address, $target);
}

sub telegram_signal_topic {
my ($server, $channel, $topic, $nick, $address) = @_;

return telegram_signal($server, '[CHANGE TOPIC] '.$topic, $nick, $address, $channel);
}

sub telegram_idle {
my ($text, $server, $item) = @_;

Expand Down Expand Up @@ -535,4 +547,9 @@ sub telegram_timer {

Irssi::signal_add("message public", "telegram_signal");
Irssi::signal_add("message private", "telegram_signal_private");
Irssi::signal_add("message irc action", "telegram_signal_action");
Irssi::signal_add("message topic", "telegram_signal_topic");
Irssi::signal_add('send text', 'telegram_idle');

telegram_send_message($user, "***** script (re)loaded");

0 comments on commit 0ca11c7

Please sign in to comment.