Adam
view release on metacpan or search on metacpan
ex/ai-bot.pl view on Meta::CPAN
my $reason = $args->{reason} || '';
$self->info("PM to $args->{nick}: $args->{message}" . ($reason ? " (reason: $reason)" : ''));
$self->privmsg($args->{nick} => $args->{message});
$self->privmsg($args->{nick} => "(reason: $reason)") if $reason;
return $tool->text_result("Private message sent to $args->{nick}.");
},
);
$server->tool(
name => 'whois',
description => 'Look up information about an IRC user (real name, host, channels, idle time, etc.). The result arrives asynchronously â you will see it as a system message shortly after calling this.',
input_schema => {
type => 'object',
properties => {
nick => { type => 'string', description => 'The nick to look up' },
},
required => ['nick'],
},
code => sub {
my ($tool, $args) = @_;
$self->irc->yield(whois => $args->{nick});
ex/ai-bot.pl view on Meta::CPAN
PRIVATE MESSAGES:
- You can receive and send private messages (PMs).
- Incoming PMs appear as system messages with the sender's nick and host.
- NEVER announce in the channel that you sent a PM. That's private. Just do it quietly.
If someone asked you to PM someone, just confirm briefly like "done" or "sent".
- Use send_private_message to reply privately.
- Good for sensitive info, personal conversations, or things not for the whole channel.
WHOIS:
- Use the whois tool to look up info about a user (real name, host, channels, idle).
- Results arrive asynchronously as a system message â you'll see them shortly after.
- Great for learning about new people or checking if someone's host changed.
ALARMS:
- Use set_alarm to wake yourself up after a delay in seconds (10-3600).
- When the alarm fires, you get a new message with your reason and can decide what to do.
- Useful for follow-ups, reminders, checking back on something, or timed actions.
- When you ask someone a question, set an alarm (120-300s) to follow up
if they don't answer. But when the alarm fires, consider if they just moved on
â sometimes staying silent is the right call even then.
( run in 2.865 seconds using v1.01-cache-2.11-cpan-df04353d9ac )