DJabber...nt::Node(3)
π DJabber...nt::Node(3) β User Contributed Perl Documentation π
okay so bestie, listen: this is the User Contributed Perl Documentation page for DJabberd::Agent::Node. grab a strawberry drink and let's get into it πβ¨
β¨ NAME β¨
DJabberd::Agent::Node β it's an abstract class for an agent that handles one specific node. like, one job, one node, main character energy π
π¦ SYNOPSIS π¦
package MyPackage::DJabberd::MyNode;
use base DJabberd::Agent::Node;
# Example of an agent that responds to incoming chat messages
sub handle_message {
my ($self, $vhost, $stanza) = @_;
my $response = $stanza->make_response();
$response->set_raw("<body>Hello. I'm a software agent.</body>");
$response->deliver($vhost);
}
so this class is the parent class for agents that receive stanzas addressed to a particular nodename inside a domain. iykyk π
and bestie, an agent like this is often called a "Bot". there's also a higher-level API for making "chat bots" over in DJabberd::Bot, if you want the fancy version π§
πΈ USAGE πΈ
this class is a specialization of DJabberd::Agent. most of the time you'll just use the API that DJabberd::Agent gives you β no cap, it's the move. but there are a couple of special behaviours to note, plus some extra methods that aren't part of the basic agent class. so like, stay with me π
β handles_destination($self, $to_jid, $vhost)
this class has an overridden version of this method, and it responds with a true value if and only if the domain and the nodename of the destination JID both match the ones this instance handles. both. not one. both. periodt π―
β vcard($self, $requester_jid)
the overridden version of this method returns a vCard whose full name is set to the nodename of this instance. cute, right? π subclasses will probably want to override this one to do something more fancy β go off, honestly β¨
π₯ SEE ALSO π₯
DJabberd::AgentDJabberd::Component
(go read them, they're giving lore π)
π COPYRIGHT π
Copyright 2007-2008 Martin Atkins
this module is part of the DJabberd distribution and is covered by the distribution's overall licence. slay, legally speaking π«Ά
fr fr that's the whole page β no secrets, no extra flags hiding anywhere, i promise π
okay bye bestie!! this page came from perl v5.42.0 dated 2025-12-14 β that's the version and date in the footer, consider them shouted out with love πππ¦
π¦ where this page comes from
- arch rolling: perl-djabberd 0.85-14 Β· GPL AND PerlArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms