TGSendMessage - Sreyas-Sreelal/tgconnector GitHub Wiki

TGSendMessage

  • Description

    Sends text messages to specified chatid.

  • Parameters

    • TGBot:bot - bot instance id
    • const TGChatId:chatid[] - chat id to which message to be sent
    • const text[] - message to be send in string literal
    • TGMessage:reply_id - (optional) send this message as a reply
    • TGParseMode:parse_mode - (optional) parse the message in specified format before sending
    • callback[] - (optional) - Callback to be called after message is send.
  • Example

    new TGBot:bot = TGConnect("your_bot_token_here");
    new TGChatId:chatid[] = "562896556";//replace with your chatid
    
    TGSendMessage(
    	bot,
    	chatid,
    	"`markdown text` ***bold*** _italic_ 123",
    	.parse_mode=MARKDOWN,
    	.callback="SendingMessage"
    );
    
    forward SendingMessage(TGBot:bot,TGMessage:messageid);
    public SendingMessage(TGBot:bot,TGMessage:messageid) {
    	//bot is bot instance
    	//messageid is send message' id
    	return 1;
    }