Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mnr73/telegrambotapi
simple telegram bot API
https://github.com/mnr73/telegrambotapi
Last synced: 7 days ago
JSON representation
simple telegram bot API
- Host: GitHub
- URL: https://github.com/mnr73/telegrambotapi
- Owner: mnr73
- License: mit
- Created: 2018-09-12T13:02:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T08:20:55.000Z (about 6 years ago)
- Last Synced: 2024-12-09T23:52:26.009Z (about 1 month ago)
- Language: PHP
- Size: 25.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# telegramBotApi
## simple telegram bot API with multiple bot support for php
install with composer
```
composer require miladnazari/telegram-bot-api
```## Usage
### create new object
```
$api = new \miladnazari\telegramBotApi\api('YOUR-BOT-TOKEN');//create with more options
$api = new \miladnazari\telegramBotApi\api('YOUR-BOT-TOKEN'[, bool $getResult = true [, int $connectionTimeOut = 10 [, int $responseTimeOut = 50 ]]]);
```### get me method
```
$res = $api->action('getMe')->shoot();// return {"ok":true,"result":{"id":598765309,"is_bot":true,"first_name":"G11\ufe0f\u20e3","username":"mnrG1bot"}} in std class
```### sendMessage method
```
$res = $api->action('sendMessage')
->param([
'chat_id' => 'ID OR USERNAME',
'text' => 'FIRTS TEXT TO SEND',
])
->shoot();
```