257/5000
I created a program that downloads any file sent to the bot, however for api limitations the maximum allowed and 20mb anything more than that will give an error ps: sorry, i speak only portuguese-br message translated by google translator 😃 my code
;@PRIVATE CHAT MESSAGE; replace 946 to 962 in telegran api udf
If(Json_Get($Json,'[result][0][message][chat][type]') = 'private') Then
Local $msgData[10] = [ _
Json_Get($Json,'[result][0][update_id]'), _
Json_Get($Json,'[result][0][message][message_id]'), _
Json_Get($Json,'[result][0][message][from][id]'), _
Json_Get($Json,'[result][0][message][from][username]'), _
Json_Get($Json,'[result][0][message][from][first_name]') _
]
If(Json_Get($Json,'[result][0][message][text]')) Then $msgData[5] = Json_Get($Json,'[result][0][message][text]')
If(Json_Get($Json,'[result][0][message][video][file_id]')) Then $msgData[9] = Json_Get($Json,'[result][0][message][video][file_id]') ; detects videos
If(Json_Get($Json,'[result][0][message][document][file_id]')) Then $msgData[9] = Json_Get($Json,'[result][0][message][document][file_id]');detects documents
; TODO: Media recognition
Return $msgData
While 1
$msgData = _Polling()
If $msgData[9] <> "" then
SendMsg($msgData[2],"Downloads starts on remote machine")
$FileID = $msgData[9]
$fileName = __DownloadFile(__GetFilePath($FileID))
If $fileName Then
_SendMsg($msgData[2],"Download OK" & $fileName)
Else
_SendMsg($msgData[2],"download Erro")
Endif
EndIf
wend