#include <WinHttp.au3>
_SendDocument("чат id","токен бота","путь до файла")
Func _SendDocument($ChatID,$bot_token,$Document,$Caption = '',$ReplyMarkup = Default,$ReplyToMessage = '',$DisableNotification = False)
Local $Query = 'https://api.telegram.org/bot'&$bot_token&'/sendDocument'
Local $hOpen = _WinHttpOpen()
Local $Form = '<form action="' & $Query & '" method="post" enctype="multipart/form-data">' & _
'<input type="text" name="chat_id"/>' & _
'<input type="file" name="document"/>' & _
'<input type="text" name="caption"/>'
If $ReplyMarkup <> Default Then $Form &= ' <input type="text" name="reply_markup"/>'
If $ReplyToMessage <> '' Then $Query &= '<input type="text" name="reply_to_message_id"/>'
If $DisableNotification Then $Form &= ' <input type="text" name="disable_notification"/>'
$Form &= '</form>'
Local $Response = _WinHttpSimpleFormFill($Form,$hOpen,Default, _
"name:chat_id", $ChatID, _
"name:document", $Document, _
"name:caption", $Caption, _
"name:reply_markup", $ReplyMarkup, _
"name:reply_to_message_id", $ReplyToMessage, _
"name:disable_notification", $DisableNotification)
_WinHttpCloseHandle($hOpen)
MsgBox(0,"",$Response)
EndFunc