Jump to content

Recommended Posts

There was the answer in an old message here.

You must use a string with the "%0A" code:

"my message%0Anewline"

Share this post


Link to post
Share on other sites

Thanks.

15 hours ago, frank10 said:

There was the answer in an old message here.

You must use a string with the "%0A" code:

"my message%0Anewline"

 

Share this post


Link to post
Share on other sites

@LinkOut SendMessage doesn't works for me and refers to WinHTTP file

I've enabled OpenVPN too, because I'm in restricted country

please fix this problem, this UDF is very important for me

please add the feature if connection was slow or disconnected then waits for connection

Edited by Colduction

Share this post


Link to post
Share on other sites
On 10/20/2017 at 9:34 AM, maskat said:

I've found the problem it came from our proxy... I tried your script with a conneciotn without proxy it' works perfectly thank you

Would be nice to add a proxy configuration option to the code.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

How to make conversations with Bot in all groups that bot already is a member of them?

For example if i (or others) send /get, then bot send "OK!"


I recommend to you to get COVID-19, but don't get Wife

Share this post


Link to post
Share on other sites

Hi all guys,

is there a way to let my program in "polling" while continuing doing its job?

In fact I see that _polling() cycles waiting for messages coming from Telegram and inhibites all other activities of a program,

I would like to keep doing what i currently do (in my case defining data for GIS, Geographical Information System) while waiting if GIS receives messages from Telegram.

I tried to implement an adlibregister but I keep getting locked in the while 1 that won't exit from cycle.

Thanks all,

Marco

Share this post


Link to post
Share on other sites

HI all,

another doubt: 

I keep getting

{"ok":false,"error_code":400,"description":"Bad Request: PHOTO_INVALID_DIMENSIONS"}

when I try to send photo (I'm using _sendphotoN)

Func _SendPhotoN($ChatID, $Path, $Caption = "")
    Local $Query = $URL & '/sendPhoto'
    $sForm = _
            '<form action="' & $Query & '" method="post" enctype="multipart/form-data">' & _
            ' <input type="text" name="chat_id"/>' & _
            ' <input type="file" name="photo"/>' & _
            ' <input type="text" name="caption"/>' & _
            '</form>'

    ; Initialize and get session handle
    $hOpen = _WinHttpOpen()
    $hConnect = $sForm ; will pass form as string so this is for coding correctness because $hConnect goes in byref
    ; Register callback function
    _WinHttpSimpleFormFill_SetUploadCallback(UploadCallback)
    ; Fill form
    $sHTML = _WinHttpSimpleFormFill($hConnect, $hOpen, _
            Default, _
            "name:chat_id", $ChatID, _
            "name:photo", $Path, _
            "name:caption", $Caption)
    ; Collect error number
    $iErr = @error
    ; Unregister callback function
    _WinHttpSimpleFormFill_SetUploadCallback(0)
    ; Kill progress bar window
    ; Close handles
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hOpen)

    If $iErr Then
        MsgBox(4096, "Error", "Error number = " & $iErr)
        ConsoleWrite("! error:" & $iErr & @CRLF & $sHTML & @CRLF)
    Else
        ConsoleWrite($sHTML & @CRLF)
    EndIf
    Return $iErr

EndFunc   ;==>_SendPhotoN

Func UploadCallback($iPrecent)
    If $iPrecent = 100 Then
        ; ProgressSet(100, "Done", "Complete")
        Sleep(800) ; give some time for the progress bar to fill-in completely
    Else
        ; ProgressSet($iPrecent, $iPrecent & "%")
    EndIf
EndFunc   ;==>UploadCallback

img is a .jpg (10kb), nothing special.

Any suggestion?

Thanks,

M.

Share this post


Link to post
Share on other sites

Does this still work?  I just tried it with your sample file and it spews whole bunch of syntax errors in winhttp file.  

Share this post


Link to post
Share on other sites
Posted (edited)

Is it possible for the bot to receive images/videos? The Polling function detects it but not sure if it's even possible...

Sample 

While 1
    $msgData = _Polling()
    _ArrayDisplay($msgData)
    $data = $msgData[5]
    ConsoleWrite($data & @CRLF)
    _SendMsg($ChatID, "Your message was: " & $data)
WEnd

 

Edited by badcoder123

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Colduction
      Hi AutoIt Members and Programmers, i have a problem with Telegram UDF that does not work on some of my servers, Telegram is not restricted in these machines, here is console output in Windows 7 (Server):
      >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\tests\Test.au3" /UserParams +>20:20:40 Starting AutoIt3Wrapper (19.1127.1402.0} from:SciTE.exe (4.2.0.0) Keyboard:00000429 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\.NetFramework\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\.NetFramework\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\tests\Test.au3 +>20:20:40 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\tests\Test.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. Test file for Telegram UDF (https://github.com/xLinkOut/telegram-udf-autoit). This file need a valid ChatID of a Telegram user who has already sent at least a message to the bot, and a valid token given by @BotFather. Insert this data in the source code. "C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\src\Telegram.au3" (1098) : ==> The requested action with this object has failed.: $oHTTP.Send() $oHTTP^ ERROR ->20:20:41 AutoIt3.exe ended.rc:1 +>20:20:41 AutoIt3Wrapper Finished. >Exit code: 1 Time: 1.56 It's really annoying problem in WinHTTP
    • By Colduction
      Hi guys, i'm using Telegram UDF by @LinkOut from github with latest update, but this UDF has not any parse_mode ability in SendDocument and other send file's functions to make texts bold, italic or underline and i can't send Emojis via these functions too. i've tried to change HTML section of multipart/form-data but i did not get correct results.

      For example, i can't get correct results by sending a document with this URL Encoded caption: %F0%9F%93%84%20*Test*%20%F0%9F%93%84

      I will be happy to help me in this section. Thanks!
    • By pat4005
      A tiny UDF that can shoot magic packets at your computers to wake them the heck up. All credits to Olish.
      The only parameter it needs to be specified – is your machine's MAC-address (ip address (the second parameter), at which you will be sending magic packet is generating automatically from @IPAddress1 macro)
      Example:
      _WoL_WakeDevice('001CC0CAED7A') ; the second parameter (if necessery) must be a broadcast address of your local network segment (i.e. 192.168.0.255 for a network 192.168.0.0)  
      _WakeOnLan.au3
    • By MrCreatoR
      This UDF allows to create formatted label using pseudo element RichLabel (RichEdit actually). Formating is set by using special modificator similar to <font> tag in Html.
      Notes: This UDF is a transformation-continuation of related UDF


      Example:
      Download:
      GUIRichLabel_1.2.zip
      Small syntax related fix: GUIRichLabel_1.1.zip
      GUIRichLabel_1.1.zip
       
      History version:
×
×
  • Create New...