- if ($t == 0) {
- &::msg($recipient, "You have no botmail.");
- } else {
- my $ago = &::Time2String(time() - $H->{time});
- &::msg($recipient, "From $H->{srcwho} ($H->{srcuh}) on $H->{time} [$ago]:");
- &::msg($recipient, $H->{message});
- &::dbDel("botmail", "id", $H->{id});
+ if ( scalar( keys %hash ) <= 1 ) {
+ &::msg( $recipient, "You have no botmail." );
+ }
+ else {
+ my $date = scalar( gmtime $hash{'time'} );
+ my $ago = &::Time2String( time() - $hash{'time'} );
+ &::msg( $recipient,
+ "From $hash{srcwho} ($hash{srcuh}) on $date ($ago ago):" );
+ &::msg( $recipient, $hash{'msg'} );
+ &::sqlDelete( 'botmail',
+ { 'dstwho' => $hash{dstwho}, 'srcwho' => $hash{srcwho} } );