--- ChivanetConvoBot/convobot 2025/02/03 18:14:15 1.5 +++ ChivanetConvoBot/convobot 2025/02/05 01:03:18 1.6 @@ -9,6 +9,9 @@ # Licensed AGPL-3.0 # # $Log: convobot,v $ +# Revision 1.6 2025/02/05 01:03:18 snw +# Fix invite and seen commands to support screen names with spaces +# # Revision 1.5 2025/02/03 18:14:15 snw # Further work on bot # @@ -181,7 +184,9 @@ sub chat_im_in { if($who ne $botsn) { if($cmd[0] eq "!seen") { if(exists($cmd[1])) { - get_seen_status($cmd[1], $chat); + my @sna = @cmd[1..$#cmd]; + my $ssn = join(' ', @sna); + get_seen_status($ssn, $chat); } else { $chat->chat_send("Syntax: !seen screenname"); @@ -194,9 +199,17 @@ sub chat_im_in { my $fortune = `/usr/games/fortune`; $room->chat_send($fortune); } + elsif($cmd[0] eq "!invite") { + if(exists($cmd[1])) { + my @sna = @cmd[1..$#cmd]; + my $ssn = join(' ', @sna); + $chat->invite($ssn, "Please join us in $chatroom!
Requested by $who"); + } + } elsif($cmd[0] eq "!help") { $room->chat_send("You can enter the following commands:"); $room->chat_send(" !seen screenname (find out when screenname was last in the chat)"); + $room->chat_send(" !invite screenname (invite screenname to the chat)"); $room->chat_send(" !speak (send a random message)"); $room->chat_send(" !quote (send a quote)"); }