#!/usr/local/bin/perl

# This is a module that allows users to kick someone at the price of also being kicked themself.

# These are the variables passed to each function call.
#
# $_[0] = name for this module (surely you already know this, but still)
# $_[1] = sending nickname
# $_[2] = sending username
# $_[3] = sending hostmask
# $_[4] = sending channel (or botnick in case of PM)
# $_[5] = current value for $modchan
# $_[6] = current value for $botnick
# $_[7] = first argument given in IRC
# $_[8] = second argument given in IRC etc.

# The package name must match the filename + .pm, so this file should be called "kamikaze.pm".
package kamikaze;

sub public {
	@public = ("kick");
}

sub kick {
	if($_[7] =~ $_[6]) { #Make sure they're not trying to kick the bot.
		nanobot::snd("KICK $_[4] $_[7] No way buddy!");		
	} else {
		nanobot::snd("KICK $_[4] $_[7] Kamikaze!");
		nanobot::snd("KICK $_[4] $_[1] Kamikaze!");
	}
}

sub help {
	nanobot::snd("NOTICE $_[4] :Usage: !kamikazi.kick user: kicks any user, but also kicks you!");
}

# A module must always end with the line "1;", Perl demands it.
1;
