Hello,In the previous code is sending only a message, just this is done in the onreceivemessage method. I can show a more extensive piece of code, if you explain what exactly you need and I can put in the examples folder in lib
I did a bit of testing, but I still could not make a working program.
Is it possible to have a source such as sending only a message to the bot?
Thanks in advance, Mario
tgsendertypes.pas(1746,45) Error: Identifier not found "stTLSv1_1"
Hi, If I comment it out it compiles and runs but when it runs I get SSL errors.Can You help us?
I tried the project on Windows and there it works 100%. I then tried it on The Raspbarian Desktop in a virtual machine. There I get the same error that the variable does not exist.
I then tried it on Debian Desktop. There it compiles but I get SSL error also.
On Raspberry Pi I use it on Raspbian Buster (Debian 10) and FPC is 3.3.1 and Lazarus is 2.0.1
I think that last commit (with OpenSSL in uses clause) is invalid for trunk FPC. Unit fpopenssl has many changes in trunk version of freepascalWell not too many: the only thing that is affected is the protocol defaults. Must be tls 1.1 or higher.
Earlier it works without explicitly specifying of SSL type, and did not even need to specify fpopenssl unit in the uses block. As I understand works without this and OS itself defines that use. Maybe I'm wrong. Then one of the users of the library reported that the new Ubuntu 1.9 did not works with lib (SSL problem) and offered a commit https://github.com/Al-Muhandis/fp-telegram/commit/fafbe6dc7fd86756208ee17f1c87567da9a90165 with an explicit specifying of a secure connectionI think that last commit (with OpenSSL in uses clause) is invalid for trunk FPC. Unit fpopenssl has many changes in trunk version of freepascalWell not too many: the only thing that is affected is the protocol defaults. Must be tls 1.1 or higher.
I suppose telegram adheres to this too.
regarding flqueue (and possibly other places):THanks, But flqueue unit is not used anywhere in the library now. It remained because of backward compatibility. I will probably delete this unit in the following commits
You can do this and remove all ifdef's regarding the 32/64 cpu tests.
{$mode objfpc} {$macro on}{$if defined(CPU64)} {$define interlockedCompareExchange:=interlockedCompareExchange64} {$define interlockedIncrement:=interlockedIncrement64} {$ifend}
That is, unless you want to keep Delphi compatibility of course, but your code is mode objpas and not mode delphi anyway.
Very important and very small commit: change TLS version (https://github.com/Al-Muhandis/fp-telegram/commit/f3cc8bdd4c40d146f7d43483f79d088bcc047586) for HTTPS request to telegram endpoint. TLSv1_1 is not supported now by telegram server.
Other news: I want to abstract HTTP client lib from the fp-telegram library so that you can connect different HTTP libraries in addition to native ones (Synapse, indy etc)
use an HTTPS proxy (the native client, unfortunately, does not support)The trunk version does support it. It does not use new compiler features, so you may simply check out and use with 3.0.4.
Thanks, I'll recheck ituse an HTTPS proxy (the native client, unfortunately, does not support)The trunk version does support it. It does not use new compiler features, so you may simply check out and use with 3.0.4.
No, FPHTTPClient with HTTP proxy to HTTPS url is not works, even in trunk version! You can check any case.use an HTTPS proxy (the native client, unfortunately, does not support)The trunk version does support it. It does not use new compiler features, so you may simply check out and use with 3.0.4.
Hi,Try last commit https://github.com/Al-Muhandis/fp-telegram
today i have updated FPC to 3.2.0, on my Ubuntu 64 bit.
Compiling, i have this error:
fgl.pp(1152,5) Note: Call to subroutine "function TFPGObjectList<tgtypes.TTelegramPhotoSize>.Add(const Item:TTelegramPhotoSize):LongInt;" marked as inline is not inlined fgl.pp(1152,18) Note: Call to subroutine "function TFPGObjectList<tgtypes.TTelegramPhotoSize>.Get(Index:LongInt):TTelegramPhotoSize;" marked as inline is not inlined tgtypes.pas(571,19) Note: Call to subroutine "operator :=(const source:Variant):AnsiString;" marked as inline is not inlined tgtypes.pas(1036,7) Note: Call to subroutine "function TFPGObjectList<tgtypes.TTelegramMessageEntityObj>.Add(const Item:TTelegramMessageEntityObj):LongInt;" marked as inline is not inlined tgtypes.pas(1041,7) Note: Call to subroutine "function TFPGObjectList<tgtypes.TTelegramPhotoSize>.Add(const Item:TTelegramPhotoSize):LongInt;" marked as inline is not inlined tgfclhttpclientbroker.pas(79,44) Error: Identifier not found "stTLSv1_2"
Source tgfclhttpclientbroker:
TSSLSocketHandler(AHandler).SSLType:=stTLSv1_2; // <--
It'ìs a bug?
Thanks in advance, Mario
P.S. Seems that adding uses of "sslbase" solve the problem
Thanks for your job.Thanks!
Hi, Mario
I'm using the tgsendertypes unit to send output from a daily cron job to a group. Good stuff! Thank you.Thanks )