Skip to content

Instantly share code, notes, and snippets.

@Al-Muhandis
Created September 29, 2022 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Al-Muhandis/cf4b77a95c4461c2e23614e512670c3e to your computer and use it in GitHub Desktop.
Save Al-Muhandis/cf4b77a95c4461c2e23614e512670c3e to your computer and use it in GitHub Desktop.
Just send message with inlinekeyboard
unit Unit1;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, tgsendertypes
;
implementation
procedure JustSend(const aToken, aMsg: String; ChatID: Int64);
var
Bot: TTelegramSender;
ReplyMarkup: TReplyMarkup;
InlineKeyboard: TInlineKeyboard;
begin
Bot:=TTelegramSender.Create(aToken);
ReplyMarkup:=TReplyMarkup.Create;
try
InlineKeyboard:=ReplyMarkup.CreateInlineKeyBoard;
InlineKeyboard.AddButton('Кнопка 1', 'data 1');
Bot.sendMessage(ChatID, aMsg, pmDefault, False, ReplyMarkup);
finally
ReplyMarkup.Free;
Bot.Free;
end;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment