2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

50_SSChatBot: contrib 1.2.0

git-svn-id: https://svn.fhem.de/fhem/trunk@20881 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-01-04 16:08:31 +00:00
parent b2db43c739
commit f9c63b0b74

View File

@ -3,7 +3,7 @@
#########################################################################################################################
# 50_SSChatBot.pm
#
# (c) 2019 by Heiko Maaz
# (c) 2019-2020 by Heiko Maaz
# e-mail: Heiko dot Maaz at t-online dot de
#
# This Module can be used to operate as Bot for Synology Chat.
@ -49,6 +49,7 @@ eval "use Net::Domain qw(hostname hostfqdn hostdomain domainname);1" or my $SSC
# Versions History intern
our %SSChatBot_vNotesIntern = (
"1.2.0" => "04.01.2020 check that Botname with type SSChatBot does exist and write Log if not ",
"1.1.0" => "27.12.2019 both POST- and GET-method are now valid in CGI ",
"1.0.1" => "11.12.2019 check OPIDX in parse sendItem, change error code list, complete forbidSend with error text ",
"1.0.0" => "29.11.2019 initial "
@ -1596,8 +1597,12 @@ sub SSChatBot_CGI() {
# check ob angegebenes SSChatBot Device definiert, wenn ja Kontext auf botname setzen
$name = $h->{botname}; # das SSChatBot Device
return ( "text/plain; charset=utf-8", "No SSChatBot device for webhook \"/outchat\" exists" ) unless (IsDevice($name, 'SSChatBot'));
$hash = $defs{$name}; # hash des SSChatBot Devices
unless (IsDevice($name, 'SSChatBot')) {
Log 1, "ERROR - No SSChatBot device \"$name\" of Type \"SSChatBot\" exists";
return ( "text/plain; charset=utf-8", "No SSChatBot device for webhook \"/outchat\" exists" );
}
$hash = $defs{$name}; # hash des SSChatBot Devices
if (!defined($h->{token})) {
Log3($name, 5, "$name - received insufficient data:\n".Dumper($args));