aki/api-bot-telegram

Telegram机器人

1.1.0 2017-10-21 17:48 UTC

This package is auto-updated.

Last update: 2024-09-13 11:21:09 UTC


README

安装

安装此扩展的首选方式是通过 Composer

运行以下命令之一

php composer.phar require aki/api-bot-telegram "*"

"aki/api-bot-telegram": "*"

将以下内容添加到您的 composer.json 文件的 require 部分中。

可用方法列表

方法列表

getMe
sendMessage
forwardMessage
sendPhoto
sendAudio
sendDocument
sendSticker
sendVideo
sendLocation
sendChatAction
getUserProfilePhotos
getUpdates
setWebhook
getChat
getChatAdministrators
getChatMembersCount
getChatMember
answerCallbackQuery
editMessageText

用法

扩展安装完成后,只需在您的代码中通过以下方式使用它:

<?php 
$telegram = new Telegram([
    'botToken' => 'your bot token..',
]);
$telegram->sendMessage([
        'chat_id' => Input::getChatID(),
        'text' => 'test',
]); 
?>