Skip to content

Instantly share code, notes, and snippets.

@foxiepaws
Forked from LambdaSix/irssi_nick.pl
Last active August 29, 2015 14:14
Show Gist options
  • Save foxiepaws/903117b0e0091897fb63 to your computer and use it in GitHub Desktop.
Save foxiepaws/903117b0e0091897fb63 to your computer and use it in GitHub Desktop.
my %saved_pronouns;
sub save_pronouns {
open PRONOUNS, ">$ENV{HOME}/.irssi/saved_pronouns";
foreach my $nick (keys %saved_pronouns) {
print COLORS "$nick:$saved_pronouns[$nick]\n";
}
}
sub load_pronouns {
open PRONOUNS, "$ENV{HOME}/.irssi/saved_pronouns";
while <PRONOUNS> {
my @lines = split '\n';
foreach my $line (@lines) {
my($nick,$pronoun) = split ":", $line;
$saved_pronoun[$nick] = $pronoun;
}
}
}
sub sig_public {
my ($server,$msg,$nick,$address,$target) = @_;
my $pronoun = $pronouns[$nick];
if (!$pronoun) {
$pronoun = $session_pronouns{$nick};
}
$server->command('/^format pubmsg [$pronoun] /* whatever format strings are, cant remember */
}
}
sub cmd_pronoun {
/* Add commands for adding & removing */
}
Irssi::command_bind('pronoun', 'cmd_pronoun');
Irssi::signal_add('message public', 'sig_public');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment