Git Product home page Git Product logo

tinjecttelegram_delphi's Introduction

IMG_Logo_TInjectTelegram_s_Fundo

This Component was Created by ITDevCon in an open source collaborative project, developed by Ruan Diego Lacerda Menezes for use and consumption of the Official Telegram Bot API via Delphi

Help maintain this project, follow the Links for donations


Donation via PAYPAL

Use QR CODE, if you prefer, to make your donation via PAYPAL

QR CodeDoacoesTInjectTelegram

TInjectTelegram for Delphi

To get the latest updates, go here

Suport Groups for developers:

TInjectTelegram UPDATES for Delphi by (dieletro) LMCODE


  • Component version 1.3.6
  • Updated for the latest version of the Telegram Bot API, version 5.4 of Nevember 05, 2021.
  • Component version 1.3.5
  • Updated for the latest version of the Telegram Bot API, version 5.3 2021.
  • Component version 1.3.4
  • Updated for the latest version of the Telegram Bot API, version 5.2 2021.
  • Component version 1.3.3
  • Updated for the latest version of the Telegram Bot API, version 5.1 of March 09, 2021.
  • Component version 1.3.0
  • New design for the component and a general restructuring has been carried out, so this new component will no longer have conflicts with other installed versions.
  • Component version 1.2.0
  • Updated for the latest version of the Telegram API, version 5.0 of November 24, 2020.

Run Your Own Bot API Server

  • Bot API source code is now available at telegram-bot-api. You can now run your own Bot API server locally, boosting your bots' performance (check this out to see if this will benefit your project).
  • Added the method logOut, which can be used to log out from the cloud Bot API server before launching your bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.
  • Added the method close, which can be used to close the bot instance before moving it from one local server to another.

Transfer Bot Ownnership

  • You can now use @BotFather to transfer your existing bots to another Telegram account.

Working with Groups

  • add in ItgChat and TtgChat function LinkedChatId: Integer; function location: ItgChatLocation; function SlowModeDelay: Integer; function Permissions: ItgChatPermissions; function Bio: String;
  • Now the method getChat result this more two new property
  • New Interfaces and Objects ItgChatLocation e TtgChatLocation ItgChatPermissions e TtgChatPermissions
  • add unbanChatMember only_if_banned Boolean Optional (Do nothing if the user is not banned)

Webhooks

  • add param in method SetWebHook const IpAddress: String; const DropPendingUpdates: Boolean;
  • add param in method DeleteWebhook const DropPendingUpdates: Boolean;
  • add property in ItgWebhookInfo e TtgWebhookInfo function IpAddress: String;

Other updates

  • add property in ItgFile and TtgFile function FileUniqueId: string;
  • add property in ItgAudio and TtgAudio function Thumb: ItgPhotoSize; function FileName: string;
  • add property in ItgVideo and TtgVideo function FileName: string;

Multiple Pinned Messages

  • Added the ability to pin messages in private chats.
  • Added the parameter MessageId to the method function UnPinChatMessage( const ChatId: TtgUserLink; const MessageId: Int64): Boolean; to allow unpinning of the specific pinned message.
  • Added the method function UnPinAllChatMessages(const ChatId: TtgUserLink): Boolean; which can be used to unpin all pinned messages in a chat.

File Albums

  • Added support for sending and receiving audio and document albums in the method sendMediaGroup.

Live Locations

  • Added the fields LivePeriod, HorizontalAccuracy, Heading, ProximityAlertRadius to the Interface ItgLocation and class TtgLocation, representing a maximum period for which the live location can be updated.
  • Added support for live location heading: added the field heading to the classes TtgLocation, TtgInlineQueryResultLocation, TtgInputLocationMessageContent and the parameter Heading to the methods sendLocation and editMessageLiveLocation.
  • Added parameter AllowSendingWithoutReply to the sendLocation method
  • Added the interface ItgProximityAlertTriggered and type TtgProximityAlertTriggered and the field ProximityAlertTriggered to the interface ItgMessage and class TtgMessage.
  • Added in the ItgMessage Interface function SenderChat: ItgChat; function ForwardSenderName: String; function proximity_alert_triggered: ItgProximityAlertTriggered;

Anonymous Admins

  • Added the field SenderChat to the class TtgMessage, containing the sender of a message which is a chat (group or channel). For backward compatibility in non-channel chats, the field from in such messages will contain the user 777000 for messages automatically forwarded to the discussion group and the user 1087968824 (@GroupAnonymousBot) for messages from anonymous group administrators.
  • Added the field IsAnonymous to the class TtgChatMember, which can be used to distinguish anonymous chat administrators.
  • Added the parameter IsAnonymous to the method promoteChatMember, which allows to promote anonymous chat administrators. The bot itself should have the IsAnonymous right to do this. Despite the fact that bots can have the IsAnonymous right, they will never appear as anonymous in the chat. Bots can use the right only for passing to other administrators.
  • Added the CustomTitle of an anonymous message sender to the class TtgMessage as author_signature.

And More

  • Added the method CopyMessage, which sends a copy of any message. Maximum poll question length increased to 300.
  • Added the fields google_place_id and google_place_type to the classes TtgVenue, TtgInlineQueryResultVenue, TtgInputVenueMessageContent and the optional parameters google_place_id and google_place_type to the method sendVenue to support Google Places as a venue API provider.
  • Added the field allow_sending_without_reply to the methods sendMessage, sendPhoto, sendVideo, sendAnimation, sendAudio, sendDocument, sendSticker, sendVideoNote, sendVoice, sendLocation, sendVenue, sendContact, sendPoll, sendDice, sendInvoice, sendGame, sendMediaGroup to allow sending messages not a as reply if the replied-to message has already been deleted.

And Last but bot Least

  • Supported the new football and slot machine animations for the random dice. Choose between different animations (etDado, etDardo, etBasketball, etFootball, etSlotMachine) by specifying the emoji parameter in the method sendDice.

  • Component version 1.1.0
  • Code updated for the latest version of the Telegram API, version 4.9 of June 4, 2020.
  • Added the new ViaBot field to the TtgMessage object. You can now find out which bot was used to send a message.
  • Video thumbnails with support for embedded GIF and MPEG4 animations.
  • Support for new basketball animation for random data. Choose between different animations (etData, etDardos, etBasquete), specifying the emoji parameter in the sendDice method.
  • Added Telegram Passport.
  • Reading of Invoice, Dice, Poll, PassportData, in the TtgMessage object

  • Component version 1.0.0
  • Updated code for the latest version of the Telegram API, version 4.8 of April 24, 2020.
  • Name of the Modified Objects.
  • Created New Methods to be able to convert different types of array of string to JSonString
  • Added new Objects in accordance with the API
  • Bug fixes in several methods
  • Update features from version 3.5.5 to 4.8
  • Added the SendPool function (Sending Polls and Quiz).
  • Added the function SendDice (Sending a Dice or an animated Dart).
  • Fixed the SendLocation function.
  • Fixed the SendVenue function (Sending Location with Text).
  • Added the function SendAnimaion (Sending an animation).
  • Added the SendMediaGroup function (Uploading Photos and Videos Grouped).
  • Added the type TtgKeyboardButtonPollType.
  • Correction in Send Method with Buttons.
  • Added the function SendInvoice (Sending a Payment Order).

Fundo3

  • The following people contributed to this library:

Ruan Diego Lacerda Menezes (dieletro).

  1. Contacts

Aurino (Collaborator of Unit TInjectTelegram.Emoji)


  • Contributed up to API Bot 3.0 May 18, 2017

Renat Suleymanov (Al-muhandis);


Bonmario;


@ashumkin (Alexey Shumkin);


Ilya Bukhonin (MstrVLT);


Daniele Spinetti (spinettaro);


CrossUrl

Library to use end user network libraries.

Installation and other information see:

[wiki-page] https://github.com/ms301/CrossUrl/wiki [github] https://github.com/ms301/CrossUrl

To use it is necessary to have CrossURL installed, available at:

[github] https://github.com/ms301/CrossUrl

To use Telegram's TDLib API see my other projects with usage examples and are also available on Telegram's official website!

**click in exemples for see more... Usage , or access my direct link to the examples * See my TDLib examples for use with Object Pascal

tinjecttelegram_delphi's People

Contributors

dieletro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinjecttelegram_delphi's Issues

THTTPClient.DoValidateServerCertificate

D10.2.3
I put my token and my id
on start i get Certificate exception server certificate invalid or not present

Can you also elaborate on the theory behind your software?

Telegram bot management in non-stable networks

Hello Sir and thanks for your great work,
I have a question that has been bothering me for several hours.

Question:

The program works properly as long as the connection to the Telegram server is established, but if for any reason the connection is interrupted for even a moment and then it is established, it will no longer be able to respond to the requests that are sent from clients. What is your solution to solve this problem?

Bug in TInjectTelegramBot.CopyMessage

Hello Sir,
When I try to use CopyMessage, the Execute command returns a Json value in the form of {"message_id":14} and naturally it cannot convert it to Int64 and an error occurs. To temporarily solve this problem, I have changed the TInjectTelegramBot.CopyMessage method located in the TInjectTelegram.Bot.Impl unit to the following form and decided to inform you about this bug.

function TInjectTelegramBot.CopyMessage(const ChatId, FromChatId: TtdUserLink;
const MessageId: Int64; const Caption: string; const ParseMode: TtdParseMode;
const CaptionEntities: TArray; const DisableWebPagePreview,
DisableNotification: Boolean; const ReplyToMessageId: Int64;
const AllowSendingWithoutReply: Boolean; ReplyMarkup: IReplyMarkup;
const ProtectContent: Boolean): Int64;
Var
LTmpJson: String;
LJsonResult : string;
LJsonObj : TJsonObject;
begin
Logger.Enter(Self, 'CopyMessage');
LTmpJson := TJsonUtils.ArrayToJString(CaptionEntities);
LJsonResult := GetRequest.SetMethod('copyMessage') //
.AddParameter('chat_id', ChatId, 0, True) //
.AddParameter('from_chat_id', FromChatId, 0, True) //
.AddParameter('message_id', MessageId, 0, True) //
.AddParameter('caption', Caption, '', False) //
.AddParameter('parse_mode', ParseMode.ToString, '', False) //
.AddParameter('caption_entities', LTmpJson, '', False) //
.AddParameter('disable_web_page_preview', DisableWebPagePreview, False, False) //
.AddParameter('disable_notification', DisableNotification, False, False) //
.AddParameter('reply_to_message_id', ReplyToMessageId, 0, False) //
.AddParameter('allow_sending_without_reply', AllowSendingWithoutReply, False, False) //
.AddParameter('protect_content ', ProtectContent, False, False) //
.AddParameter('reply_markup', TInterfacedObject(ReplyMarkup), nil, False) //
.Execute; // {"message_id":14}
LJsonObj := TJSONObject.ParseJSONValue(LJsonResult) As TJSONObject;
try
Result := LJsonObj.GetValue('message_id');
finally
LJsonObj.Free
end;
Logger.Leave(Self, 'CopyMessage');
end;

Erro

TInjectTelegramBotReceiverBase.ReadUpdates [ Access violation at address 0078B708 in module 'ExemplosTInjectTelegram.exe'. Read of address 00000000]

D10.2.3

TJSONStringHack(LValue).Value := '';
TJSONStringHack(LValue).{$Ifdef VER330}FValue{$else}Value{$endif} :=AValue;
left side cannot have value

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.