Skip to content

mrbarnk/telegram-core-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Telegram-core-api

Telegram mini library for telegram api.

This is how to use the telegram bot api.

First of all, i'll instantiate the telegram class like this.

  $token = "The bot token you got from telegram";
  $tg = new Telegram($token);
  
  // To send message 
  
  $chat_id = "The receiver chat id";
  
  $text = "The message you want to send.";

Read markdown here

Markdown style

To use this mode, pass Markdown in the parse_mode field when using sendMessage. Use the following syntax in your message:

  *bold text*
  _italic text_
  [inline URL](http://www.example.com/)
  [inline mention of a user](tg://user?id=123456789)
  `inline fixed-width code`
  ```block_language
  pre-formatted fixed-width code block

HTML style To use this mode, pass HTML in the parse_mode field when using sendMessage. The following tags are currently supported:

  <b>bold</b>, <strong>bold</strong>
  <i>italic</i>, <em>italic</em>
  <a href="http://www.example.com/">inline URL</a>
  <a href="tg://user?id=123456789">inline mention of a user</a>
  <code>inline fixed-width code</code>
  <pre>pre-formatted fixed-width code block</pre>
  
  $parse_mode = NULL or 'Markdown';
  
  print_r($tg->sendMessage($chat_id, $text, $parse_mode));
  
  return Bot details from token.
  
  print_r($tg->getMe());
  

About

Telegram mini library for telegram api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages