aboutsummaryrefslogtreecommitdiffstats
path: root/messenger.pl
diff options
context:
space:
mode:
authorArianit Kukaj <arianit@hax.al>2025-05-26 17:35:15 +0000
committerArianit Kukaj <arianit@hax.al>2025-05-26 17:35:15 +0000
commitf0572ea86ceda0f5df29bb7f05c279092ae7e495 (patch)
treeb273627dd2fe7c6872c5f29f5b00e7ab606d4814 /messenger.pl
downloadIRCbot-sshaccount-master.tar.gz
IRCbot-sshaccount-master.zip
Diffstat (limited to '')
-rw-r--r--messenger.pl47
1 files changed, 47 insertions, 0 deletions
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;
+}