diff --git a/fhem/CHANGED b/fhem/CHANGED index beb5b9685..653465b94 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 49_TBot_List: chat/groupid can be added in start - bugfix: 98_weekprofile: Log ccutype not defined (forum #1113306) - change: Device::Firmata removed, use CPAN version (forum #114552) - bugfix: 10_FRM: Device::Firmata check (forum #114552 msg #1112141) diff --git a/fhem/FHEM/49_TBot_List.pm b/fhem/FHEM/49_TBot_List.pm index 27113876a..1a8685d62 100644 --- a/fhem/FHEM/49_TBot_List.pm +++ b/fhem/FHEM/49_TBot_List.pm @@ -86,6 +86,9 @@ # document deleteOnly # 0.7 2018-03-11 deleteonly lists / internal changes +# show entry content in response for add/del +# start list with peerid und chatid als Parameter + # ############################################################################## # TASKS @@ -270,8 +273,12 @@ sub TBot_List_Set($@) if ( $numberOfArgs == 2 ) { $tchat = ReadingsVal( $tbot, "msgChatId", undef ); $tpeer = ReadingsVal( $tbot, "msgPeerId", "" ); + } elsif ( $numberOfArgs == 4 ) { + $tpeer = AnalyzeCommandChain( $hash, "get $tbot peerId ".$args[1] ); + $tchat = AnalyzeCommandChain( $hash, "get $tbot peerId ".$args[2] ); } else { $tpeer = AnalyzeCommandChain( $hash, "get $tbot peerId ".$args[1] ); + $tchat = undef; } $ret = "No peer found or specified :$tbot: ".(( $numberOfArgs == 2 )?"":$args[1]) if ( ! $tpeer ); } @@ -945,7 +952,7 @@ sub TBot_List_handler($$$$;$) if ( ( $no >= 0 ) && ( $no < scalar(@list) ) ) { # remove from array the entry with the index - splice(@list, $no, 1); + my $rementry = splice(@list, $no, 1); my $text = join(",", @list ); @@ -953,7 +960,7 @@ sub TBot_List_handler($$$$;$) AnalyzeCommandChain( $hash, "set ".TBot_List_getConfigPostMe($hash)." add $lname $text" ); # show updated list -> call recursively - TBot_List_handler( $hash, "list_edit", $tbot, $peer, " Eintrag geloescht" ); + TBot_List_handler( $hash, "list_edit", $tbot, $peer, " Eintrag \"".$rementry."\" geloescht" ); } @@ -1156,7 +1163,7 @@ sub TBot_List_handler($$$$;$) AnalyzeCommandChain( $hash, "set ".TBot_List_getConfigPostMe($hash)." add $lname ".$addentry ); # show list again -> call recursively if ( defined($msgId ) ) { - TBot_List_handler( $hash, "list_edit", $tbot, $peer, " Eintrag hinzugefuegt" ); + TBot_List_handler( $hash, "list_edit", $tbot, $peer, " Eintrag \"".$addentry."\" hinzugefuegt" ); } else { $ret = "TBot_List_handler: $name - $tbot ERROR no msgId known for peer :$peer: chat :$chatId: cmd :$cmd: ".(defined($arg)?"arg :$arg:":""); } @@ -1348,7 +1355,7 @@ sub TBot_List_Setup($) { where <what> / <value> is one of

-
  • start <telegrambot name> [ <peerid> ]
    Initiate a new dialog for the given peer (or the last peer sending a message on the given telegrambot) +
  • start <telegrambot name> [ <peerid> [ <chatid> ] ]
    Initiate a new dialog for the given peer (or the last peer sending a message on the given telegrambot - if communication should happen in a group then both chatid with the groupid and peerid with the user id need to be specified)
  • end <telegrambot name> <peerid>
    Finalize a new dialog for the given peer on the given telegrambot