giaphiep/chatgpt-telegram
Composer 安装命令:
composer require giaphiep/chatgpt-telegram
包简介
Upgrade Laravel Telegram bots with AI-powered ChatGPT. Create engaging, lifelike conversations effortlessly
关键字:
README 文档
README
Implement Telegram bot that integrates with ChatGPT using Laravel
Table of Contents
Installation
Install this package via Composer
composer require giaphiep/chatgpt-telegram
Execute the following command to publish the migrations file to your Laravel application:
php artisan vendor:publish --tag=migrations
then run
php artisan migrate
Configuration
Step1: Create a Telegram Bot
-
Message
@BotFatherwith the following text:/newbotIf you don't know how to message by username, click the search field on your Telegram app and type
@BotFather, where you should be able to initiate a conversation. Be careful not to send it to the wrong contact, because some users have similar usernames toBotFather. -
@BotFatherreplies with:Alright, a new bot. How are we going to call it? Please choose a name for your bot. -
Type whatever name you want for your bot.
-
@BotFatherreplies with:Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot. -
Type whatever username you want for your bot, minimum 5 characters, and must end with
bot. For example:telesample_bot -
@BotFatherreplies with:Done! Congratulations on your new bot. You will find it at telegram.me/telesample_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. Use this token to access the HTTP API: 123456789:AAG90e14-0f8-40183D-18491dDE For a description of the Bot API, see this page: https://core.telegram.org/bots/api -
Note down the 'token' mentioned above.
Optionally set the bot privacy:
-
Send
/setprivacyto@BotFather. -
@BotFatherreplies with:Choose a bot to change group messages settings. -
Type (or select)
@telesample_bot(change to the username you set at step 5 above, but start it with@) -
@BotFatherreplies with:'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username. 'Disable' - your bot will receive all messages that people send to groups. Current status is: ENABLED -
Type (or select)
Disableto let your bot receive all messages sent to a group. -
@BotFatherreplies with:Success! The new status is: DISABLED. /help
Step 2: Get ChatGPT key from OpenAI
Then add the following lines to your .env file:
OPENAI_API_KEY= CHATGPT_MODEL= TELEGRAM_BOT_TOKEN=
Step 3: Set webhook receive incoming updates. (note: remember, that you need use HTTPS)
php artisan set:webhook
Usage
Contact
For questions and inquiries, you can reach me at hiep.giapvan@gmail.com.
giaphiep/chatgpt-telegram 适用场景与选型建议
giaphiep/chatgpt-telegram 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 08 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「nlp」 「telegram」 「ChatGpt」 「AI-powered」 「Conversational AI」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 giaphiep/chatgpt-telegram 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 giaphiep/chatgpt-telegram 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 giaphiep/chatgpt-telegram 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Interface for Babel Street Text Analytics
Laravel 5.6 Monolog custom telegram channel
PHP Wrapper for Telegram Bot API
A modern PHP client for the Hugging Face Inference API with full type safety and comprehensive model support
Alibaba Cloud Nlp SDK for PHP
A collection of fast and easy to use attributed string classes for PHP. Attributed strings can have multiple attributes for each character of the string and are for example used for word processors and natural language processing.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-13

