private
FBot: TTelegramBot;
protected
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
end;
procedure Register;
implementation
procedure Register;
begin
{$I telegrambot_icon.lrs}
RegisterComponents('Misc',[TDTTelegramBot]);
end;
{ TDTTelegramBot }
constructor TDTTelegramBot.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FBot:=TTelegramBot.Create(EmptyStr);
end;
destructor TDTTelegramBot.Destroy;
begin
FBot.Free;
inherited Destroy;
end;
Second way change ancestor of the source TTelegramBot class.
Are there some others? ))
So, I made first way: fptelegram_dt.lpk It is ready-made longpolling bot which you can use for the rapid developments of longpolling telegram bots. Look about longpolling here. This component ca be used in GUI and non-GUI applications, daemons and services and even in web-server. In the DTLongPolBot component, thread control takes place inside the component and you do not have to worry about it: it will be enough to activate the receiver of this component. Simple example: https://github.com/Al-Muhandis/fp-telegram/tree/master/examples/DesignTime
Mistake in class name TTDLongPolBot)
LongPoll
Yes. THank you
Corrected. So, Who has already used the design time component: reinstall it and re-add it to the form or datamodule (
Обсуждают сегодня