mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
50_SSChatBot: contrib 1.0.0
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20601 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d8972ccdfc
commit
311860d86a
@ -250,6 +250,8 @@ sub SSChatBot_Set($@) {
|
|||||||
|
|
||||||
return if(IsDisabled($name));
|
return if(IsDisabled($name));
|
||||||
|
|
||||||
|
my $idxlist = join(",",(sort keys %{$data{SSChatBot}{$name}{sendqueue}{entries}}));
|
||||||
|
|
||||||
if(!$hash->{TOKEN}) {
|
if(!$hash->{TOKEN}) {
|
||||||
# initiale setlist für neue Devices
|
# initiale setlist für neue Devices
|
||||||
$setlist = "Unknown argument $opt, choose one of ".
|
$setlist = "Unknown argument $opt, choose one of ".
|
||||||
@ -259,6 +261,7 @@ sub SSChatBot_Set($@) {
|
|||||||
$setlist = "Unknown argument $opt, choose one of ".
|
$setlist = "Unknown argument $opt, choose one of ".
|
||||||
"botToken ".
|
"botToken ".
|
||||||
"listSendqueue:noArg ".
|
"listSendqueue:noArg ".
|
||||||
|
($idxlist?"purgeSendqueue:-all-,$idxlist ":"purgeSendqueue:-all- ").
|
||||||
"sendItem:textField-long "
|
"sendItem:textField-long "
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -293,6 +296,17 @@ sub SSChatBot_Set($@) {
|
|||||||
}
|
}
|
||||||
return $sq;
|
return $sq;
|
||||||
|
|
||||||
|
} elsif ($opt eq "purgeSendqueue") {
|
||||||
|
if($prop eq "-all-") {
|
||||||
|
delete $hash->{OPIDX};
|
||||||
|
delete $data{SSChatBot}{$name}{sendqueue}{entries};
|
||||||
|
$data{SSChatBot}{$name}{sendqueue}{index} = 0;
|
||||||
|
return "All entries of SendQueue deleted";
|
||||||
|
} else {
|
||||||
|
delete $data{SSChatBot}{$name}{sendqueue}{entries}{$prop};
|
||||||
|
return "SendQueue entry with index \"$prop\" deleted";
|
||||||
|
}
|
||||||
|
|
||||||
} elsif ($opt eq "sendItem") {
|
} elsif ($opt eq "sendItem") {
|
||||||
# text="First line of message to post.\nAlso you can have a second line of message." users="user1"
|
# text="First line of message to post.\nAlso you can have a second line of message." users="user1"
|
||||||
# text="<https://www.synology.com>" users="user1"
|
# text="<https://www.synology.com>" users="user1"
|
||||||
@ -565,7 +579,7 @@ sub SSChatBot_checkretry ($$) {
|
|||||||
$rs = 86400;
|
$rs = 86400;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3($name, 2, "$name - ERROR - \"$hash->{OPMODE}\" index \"$idx\" finished faulty. Restart SendQueue in $rs seconds (retryCount $rc).");
|
Log3($name, 2, "$name - ERROR - \"$hash->{OPMODE}\" SendQueue index \"$idx\" not executed. Restart SendQueue in $rs seconds (retryCount $rc).");
|
||||||
|
|
||||||
RemoveInternalTimer($hash, "SSChatBot_chatop");
|
RemoveInternalTimer($hash, "SSChatBot_chatop");
|
||||||
InternalTimer(gettimeofday()+$rs, "SSChatBot_chatop", "$name", 0);
|
InternalTimer(gettimeofday()+$rs, "SSChatBot_chatop", "$name", 0);
|
||||||
@ -1332,7 +1346,8 @@ return;
|
|||||||
"synology",
|
"synology",
|
||||||
"synologychat",
|
"synologychat",
|
||||||
"chatbot",
|
"chatbot",
|
||||||
"chat"
|
"chat",
|
||||||
|
"messenger"
|
||||||
],
|
],
|
||||||
"version": "v1.1.1",
|
"version": "v1.1.1",
|
||||||
"release_status": "stable",
|
"release_status": "stable",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user