mirror of
https://github.com/brmlab/brmdoor.git
synced 2025-06-08 19:54:00 +02:00
rework answer
This commit is contained in:
parent
fdac0b1044
commit
db22869e4e
1 changed files with 3 additions and 3 deletions
|
@ -546,7 +546,6 @@ sub irc_public {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( my ($alpha) = $what =~ /^!alpha (.+)/ ) {
|
if ( my ($alpha) = $what =~ /^!alpha (.+)/ ) {
|
||||||
my $answer = '';
|
|
||||||
my $wa = WWW::WolframAlpha->new ( appid => 'P6XPHG-URK5HXVWXL', );
|
my $wa = WWW::WolframAlpha->new ( appid => 'P6XPHG-URK5HXVWXL', );
|
||||||
my $query = $wa->query( input => $alpha, );
|
my $query = $wa->query( input => $alpha, );
|
||||||
if ($query->success) {
|
if ($query->success) {
|
||||||
|
@ -554,15 +553,16 @@ sub irc_public {
|
||||||
if (!$pod->error) {
|
if (!$pod->error) {
|
||||||
foreach my $subpod (@{$pod->subpods}) {
|
foreach my $subpod (@{$pod->subpods}) {
|
||||||
if ($subpod->plaintext) {
|
if ($subpod->plaintext) {
|
||||||
|
my $answer = '';
|
||||||
$answer .= ($pod->title . ': ') if $pod->title;
|
$answer .= ($pod->title . ': ') if $pod->title;
|
||||||
$answer .= ($subpod->title . ': ') if $subpod->title;
|
$answer .= ($subpod->title . ': ') if $subpod->title;
|
||||||
$answer .= ($subpod->plaintext . "\n");
|
$answer .= $subpod->plaintext;
|
||||||
|
$irc->yield( privmsg => $channel => $answer );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$irc->yield( privmsg => $channel => $answer ) if $answer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue