File: command.pl

package info (click to toggle)
irssi 0.8.15-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,852 kB
  • ctags: 5,831
  • sloc: ansic: 52,878; sh: 10,180; perl: 2,572; makefile: 1,003
file content (23 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Example how to create your own /commands:

# /HELLO <nick> - sends a "Hello, world!" to given nick.

use Irssi;
use strict;
use vars qw($VERSION %IRSSI);

$VERSION = "1.00";
%IRSSI = (
    authors     => 'Timo Sirainen',
    name        => 'command',
    description => 'Command example',
    license     => 'Public Domain'
);

sub cmd_hello {
	my ($data, $server, $channel) = @_;

	$server->command("/msg $data Hello, world!");
}

Irssi::command_bind('hello', 'cmd_hello');