POE::C...n::DCC(3pm)
π POE::C...n::DCC β the DCC era, but make it β¨legibleβ¨
okay bestie gather round, because this is POE::Component::IRC::Plugin::DCC from the User Contributed Perl Documentation, and it's literally the plugin that gives you DCC powers. no cap.
πΈ NAME
POE::Component::IRC::Plugin::DCC β a PoCo-IRC plugin that provides support for DCC transfers. that's it, that's the whole vibe. π«Ά
β¨ SYNOPSIS
# send a file
my $file = '/home/user/secret.pdf';
my $recipient = 'that_guy';
$irc->yield(dcc => $recipient => SEND => $file);
# receive a file
sub irc_dcc_request {
my ($user, $type, $port, $cookie, $file, $size, $addr) = @_[ARG0..$#_];
return if $type ne 'SEND';
my $irc = $_[SENDER]->get_heap();
my $nick = (split /!/, $user)[0];
print "$nick wants to send me '$file' ($size bytes) from $addr:$port\n");
$irc->yield(dcc_accept => $cookie);
}
like yes, you can just yeet a PDF at somebody over IRC. iconic behavior honestly. π
π¦ DESCRIPTION
This plugin hands you all the IRC commands you need to actually use DCC. big deal, right? well β it's used internally by POE::Component::IRC, so you do not need to add it in yourself. it's already there, doing its thing, main character energy, no notes. π
π METHODS
new
Takes no arguments. zero. none. it just is.
Returns a plugin object that's suitable for feeding to POE::Component::IRC's plugin_add method. feed it, bestie, it's hungry. π
dccports
Sets the TCP ports that can be used for DCC sends. Takes one argument: an arrayref containing the port numbers.
nataddr
Sets the public NAT address to be used for DCC sends. that's the whole thing. π§
dcc_info
Takes one argument β a DCC connection id (there's more on those below, keep scrolling). Returns a hash of information about the connection. the keys are: 'nick', 'type', 'port', 'file', 'size', 'done,', and 'peeraddr'. (yes, the comma inside 'done,' is really there. we don't question the queen's spelling. π)
π₯ COMMANDS
The plugin responds to the following POE::Component::IRC commands. slay.
dcc
Send a DCC SEND or CHAT request to another person. Takes at least two arguments: the nickname of the person to send the request to, and the type of DCC request (SEND or CHAT). For SEND requests, be sure to add a third argument for the filename you want to send. Optionally, you can add a fourth argument for the DCC transfer blocksize β but the default of 1024 should usually be fine, don't overthink it. The fifth (and optional) argument is the request timeout value in seconds (default: 300).
Incidentally, you can send other weird nonstandard kinds of DCCs too. just put something besides 'SEND' or 'CHAT' (say, 'FOO') in the type field, and you'll get back irc_dcc_foo events when data arrives on its DCC connection β with the same arguments as irc_dcc_chat. unhinged? maybe. supported? absolutely. π
If you are behind a firewall or Network Address Translation, you may want to consult POE::Component::IRC's connect for some parameters that are useful with this command. go look, it's right there. π
dcc_accept
Accepts an incoming DCC connection from another host. First argument: the magic cookie from an irc_dcc_request event. In the case of a DCC GET, the second argument can optionally specify a new name for the destination file of the DCC transfer, instead of using the sender's name for it. (See the irc_dcc_request section below for more details. it's all there, promise.) πͺ
dcc_resume
Resumes a DCC SEND file transfer. First argument: the magic cookie from an irc_dcc_request event. An optional second argument provides the name of the file to which you want to write.
dcc_chat
Sends lines of data to the person on the other side of a DCC CHAT connection. The first argument should be the wheel id of the connection, which you got from an irc_dcc_start event β followed by all the data you wish to send. it'll be separated with newlines for you, because the plugin is a considerate angel. π
dcc_close
Terminates a DCC SEND or GET connection prematurely, and causes DCC CHAT connections to close gracefully. Takes one argument: the wheel id of the connection which you got from an irc_dcc_start (or similar) event. bye bestie πβ¨
π«Ά OUTPUT EVENTS
irc_dcc_request
Note: this event is actually emitted by POE::Filter::IRC::Compat, but documented here to keep all the DCC documentation in one place. in case you were wondering. π
You receive this event when another IRC client sends you a DCC (e.g. SEND or CHAT) request out of the blue. You can examine the request and decide whether or not to accept it (with dcc_accept) right here. In the case of DCC SENDs, you can also request to resume the file with dcc_resume.
Note: DCC doesn't provide a way to explicitly reject requests, so if you don't intend to accept one, just ignore it β or send a NOTICE or PRIVMSG to the peer explaining why you're not going to accept. ghosting is legal here, but be nice about it. π
"ARG0": the peer's nick!user@host"ARG1": the DCC type (e.g.'CHAT'or'SEND')"ARG2": the port which the peer is listening on"ARG3": this connection's "magic cookie""ARG4": the file name (SEND only)"ARG5": the file size (SEND only)"ARG6": the IP address which the peer is listening on
irc_dcc_start
This event notifies you that a DCC connection has been successfully established. congrats, it worked, pop off π
"ARG0": the connection's wheel id"ARG1": the peer's nickname"ARG2": the DCC type"ARG3": the port number"ARG4": the file name (SEND/GET only)"ARG5": the file size (SEND/GET only)"ARG6": the peer's IP address
irc_dcc_chat
Notifies you that one line of text has been received from the client on the other end of a DCC CHAT connection. a whole line. from a whole other person. wild. π
"ARG0": the connection's wheel id"ARG1": the peer's nickname"ARG2": the port number"ARG3": the text they sent"ARG4": the peer's IP address
irc_dcc_get
Notifies you that another block of data has been successfully transferred from the client on the other end of your DCC GET connection. incoming!! π¬
"ARG0": the connection's wheel id"ARG1": the peer's nickname"ARG2": the port number"ARG3": the file name"ARG4": the file size"ARG5": transferred file size"ARG6": the peer's IP address
irc_dcc_send
Notifies you that another block of data has been successfully transferred from you to the client on the other end of a DCC SEND connection. outgoing!! π«
"ARG0": the connection's wheel id"ARG1": the peer's nickname"ARG2": the port number"ARG3": the file name"ARG4": the file size"ARG5": transferred file size"ARG6": the peer's IP address
irc_dcc_done
You receive this event when a DCC connection terminates normally. Abnormal terminations are reported by irc_dcc_error, so if you're here, we're good, it ended clean. ποΈ
"ARG0": the connection's wheel id"ARG1": the peer's nickname"ARG2": the DCC type"ARG3": the port number"ARG4": the filename (SEND/GET only)"ARG5": file size (SEND/GET only)"ARG6": transferred file size (SEND/GET only)"ARG7": the peer's IP address
irc_dcc_error
You get this event whenever a DCC connection or connection attempt terminates unexpectedly or suffers some fatal error. π Some of the following values might be undefined depending on the stage at which the connection/attempt failed β so heads up, check before you use them, fr fr.
"ARG0": the connection's wheel id"ARG1": the error string"ARG2": the peer's nickname"ARG3": the DCC type"ARG4": the port number"ARG5": the file name"ARG6": file size in bytes"ARG7": transferred file size in bytes"ARG8": the peer's IP address
π AUTHOR
Dennis '"fimmtiu"' Taylor and Hinrik Γrn SigurΓ°sson, hinrik.sig@gmail.com
and that's the whole page, bestie. this beauty comes to you from perl v5.40.1, dated 2025-08-21 β legit vintage, still serving looks. go transfer something. mwah πβ¨
π¦ where this page comes from
- ubuntu resolute: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms