Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # USAGE: /topicmod [newtopic]
- sub cmd_topicmod {
- my ($newtopic, $server, $witem) = @_;
- my $topiclen = 80;
- my $oldtopic;
- my $divider = " || ";
- if (!$server || !$server->{connected}) {
- Irssi::print("Not connected to server");
- return;
- }
- if($witem && $witem->{type} eq "CHANNEL") {
- $oldtopic = $witem->{topic};
- my $temptopic = $newtopic . $divider . $oldtopic;
- if(length($temptopic) <= 80) {
- $server->command("TOPIC ".$witem->{name}." ".$temptopic);
- } else {
- Irssi::print("Topic too long");
- }
- }
- }
- Irssi::command_bind('topicmod', 'cmd_topicmod');
Add Comment
Please, Sign In to add comment