All pastes #1233 Raw Edit

Anonymous

public text v1 · immutable
#1233 ·published 2004-10-03 06:37 UTC
rendered paste body
sub cmd_music {
    # call last track from database with sql query: select * from music order by id desc limit 1;
    my $current_mp3=`psql -tc "select music from music order by id desc limit 1;"`;
    my ($data, $server, $witem) = @_;

    if (!$server) {
        Irssi::print('You are not connected to a server.');
        return;
    }

    if ($witem && ($witem->{type} eq "CHANNEL" || $witem->{type} eq "QUERY")) {
        $witem->command('me Now playing: '.$current_mp3);

    } else
    {   
        Irssi::print('Can not message this window.');
        return;
    }
}