1. This project refers to the following predecessors' projects, and it is only for friends who have just learned Flask to deploy TelegramBot on Vercel:
https://github.com/howarder3/GPT-Linebot-python-flask-on-vercel
https://github.com/zaoldyeck/telegram-innovation-chatbot/tree/basic
2. Since this project is deployed on Vercel, the code is different from the version of Docker, and Flask framework must be used and webhook must be set. Please see knowhows of setting webhook below.
3. Two environment variables must be set in Vercel's Environment Variables, namely OPENAI_API_KEY and TELEGRAM_BOT_TOKEN.
4. Please open the browser, enter the following URL, and set the webhook as the last step after deploying Vercel. The format is shown as https://api.telegram.org/bot{$token}/setWebhook?url={$webhook_url}。
The actual example is like the following example (Don't copy it directly, please use your own telegram token and the URL of the Vercel project):
https://ithelp.ithome.com.tw/articles/10245264
https://tcsky.cc/tips-01-telegram-chatbot/