Log for
SITCON BOT Testpool
Array
(
[update_id] => 753891737
[message] => Array
(
[message_id] => 135
[from] => Array
(
[id] => 109780439
[first_name] => Sean
[username] => S_ean
)
[chat] => Array
(
[id] => 109780439
[first_name] => Sean
[username] => S_ean
[type] => private
)
[date] => 1459639560
[sticker] => Array
(
[width] => 512
[height] => 512
[thumb] => Array
(
[file_id] => AAQFABM-RL4yAAQJUkzJjRmyu_8CAAIC
[file_size] => 12256
[width] => 128
[height] => 128
)
[file_id] => BQADBQADfgAD1x2LBvAF62U03JB8Ag
[file_size] => 68876
)
)
)
"/motorcycle" and "me".....
$text = $data['message']['reply_to_message']['sticker']['file_id'] ?? $data[ignore]['file_id'] ?? 'Error'
sean.taipei/telegram/src/sean.html 求解...
so what did you do before it stop working?
呼叫了一個我指定 string 型別的 function ,但是不知道塞了什麼給他
Hello mingtsay@tg,
I am ysitdbot.
You could use /help to get all commands and usage of this bot.
$text =
$data['message']['reply_to_message']['audio']['file_id'] ??
$data['message']['reply_to_message']['document']['file_id'] ??
end($data['message']['reply_to_message']['new_chat_photo'])['file_id'] ??
$text =
$data['message']['reply_to_message']['audio']['file_id'] ??
$data['message']['reply_to_message']['document']['file_id'] ??
end($data['message']['reply_to_message']['new_chat_photo'])['file_id'] ??
end($data['message']['reply_to_message']['photo'])['file_id'] ??
$data['message']['reply_to_message']['sticker']['file_id'] ??
$data['message']['reply_to_message']['video']['file_id'] ??
$data['message']['reply_to_message']['voice']['file_id'] ??
'Error';
自覺稍微能看的解法..
case 'fileid':
$reply = $data['message']['reply_to_message'] ?? [];
$file =
$reply['audio'] ??
$reply['document'] ??
$reply['new_chat_photo'] ??
$reply['photo'] ??
$reply['sticker'] ??
$reply['video'] ??
$reply['voice'] ??
[];
$text = $file['file_id'] ?? end($file)['file_id'] ?? 'Error';
sendMsg(Array(
'bot' => BOT,
'chat_id' => ChatID,
'reply_to_message_id' => MsgID,
'text' => $text,
));
break;