From c33383d1e4b132fc12c8a46e9d7d1579e2caf65d Mon Sep 17 00:00:00 2001 From: DS_Starter Date: Mon, 2 Dec 2019 20:16:48 +0000 Subject: [PATCH] 50_SSChatBot: contrib 1.0.0 git-svn-id: https://svn.fhem.de/fhem/trunk@20646 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/50_SSChatBot.pm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/fhem/contrib/DS_Starter/50_SSChatBot.pm b/fhem/contrib/DS_Starter/50_SSChatBot.pm index 1faeaddc3..1d7ab3bf1 100644 --- a/fhem/contrib/DS_Starter/50_SSChatBot.pm +++ b/fhem/contrib/DS_Starter/50_SSChatBot.pm @@ -1095,8 +1095,18 @@ sub SSChatBot_chatop_parse ($) { asyncOutput($hash->{HELPER}{CL}{1},"$out"); delete($hash->{HELPER}{CL}); - } elsif ($opmode eq "sendItem") { - + } elsif ($opmode eq "sendItem") { + my $postid = ""; + my $idx = $hash->{OPIDX}; + my $uid = $data{SSChatBot}{$name}{sendqueue}{entries}{$idx}{userid}; + if($data->{data}{succ}{user_id_post_map}{$uid}) { + $postid = $data->{data}{succ}{user_id_post_map}{$uid}; + } + + readingsBeginUpdate ($hash); + readingsBulkUpdateIfChanged ($hash, "sendPostId", $postid); + readingsBulkUpdateIfChanged ($hash, "sendUserId", $uid); + readingsEndUpdate ($hash,1); } SSChatBot_checkretry($name,0); @@ -1603,11 +1613,11 @@ sub SSChatBot_CGI() { } readingsBeginUpdate ($hash); - readingsBulkUpdateIfChanged ($hash, "recChannelid", $channelid); + readingsBulkUpdateIfChanged ($hash, "recChannelId", $channelid); readingsBulkUpdateIfChanged ($hash, "recChannelname", $channelname); - readingsBulkUpdateIfChanged ($hash, "recUserid", $userid); + readingsBulkUpdateIfChanged ($hash, "recUserId", $userid); readingsBulkUpdateIfChanged ($hash, "recUsername", $username); - readingsBulkUpdateIfChanged ($hash, "recPostid", $postid); + readingsBulkUpdateIfChanged ($hash, "recPostId", $postid); readingsBulkUpdateIfChanged ($hash, "recTimestamp", $timestamp); readingsBulkUpdateIfChanged ($hash, "recText", $text); readingsBulkUpdateIfChanged ($hash, "recTriggerword", $triggerword);