From f0572ea86ceda0f5df29bb7f05c279092ae7e495 Mon Sep 17 00:00:00 2001 From: Arianit Kukaj Date: Mon, 26 May 2025 17:35:15 +0000 Subject: Localizing REPOS --- messenger.pl | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 messenger.pl (limited to 'messenger.pl') diff --git a/messenger.pl b/messenger.pl new file mode 100644 index 0000000..4cb0152 --- /dev/null +++ b/messenger.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl +use warnings; +use strict; +use POE; +use POE::Component::IRC; + +my $irc = POE::Component::IRC->spawn( + nick => "messengerz", + server => "irc.ircnow.org", + port => 6667, + ircname => "monSSH Bot", +); + +POE::Session->create( + package_states => [ + main => [qw(_start irc_001 irc_public)], + ], +); + +$poe_kernel->run(); + +sub _start { + $irc->yield(register => "all"); + $irc->yield(connect => {}); + return; +} + +sub irc_001 { + my $sender = $_[SENDER]; + $irc->yield(join => "#debian"); + return; +} + +sub irc_public { + my ($sender, $who, $where, $what) = @_[SENDER, ARG0 .. ARG2]; + my $nick = (split /!/, $who)[0]; + my $channel = $where->[0]; + + if ($what =~ /^!help/) { + $irc->yield(privmsg => $channel => "Please for more information Private message /query monSSH !help"); + } elsif ($what =~ /^!info/) { + $irc->yield(privmsg => $channel => "Information: The server is running okay !"); + } elsif ($what =~ /^!shqip/) { + $irc->yield(privmsg => $channel => "Informatat ne shqipe jane akoma nen perpunim !"); + } + return; +} -- cgit v1.2.3