Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

edoardob90/telegram-chatgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

telegram-chatgpt

Personal assistant powered by ChatGPT as a Telegram bot. Uses the official OpenAI API.

Minimal setup

  • Create a Poetry environment and install the requirements
  • Obtain a (new) token for your bot via the @BotFather
  • Place your secrets in the .env file: TELEGRAM_BOT_TOKEN, OPENAI_API key, and the Telegram user id ADMIN_USER_ID of a user you want to be the bot's administrator
  • Create a file named .verify.json which contains the questions & answers to verify the users. The answer fields will be hashed at the first startup of the bot. The format should be the following:
[
  {"question":  "First Question",
  "answer":  "First Answer"},
  
  {"question":  "Second Question",
  "answer": "Second Answer"}
]
  • The bot can be started with a simple command like poetry run python main.py

Check out the official wiki of the python-telegram-bot library to know how and where to host this bot.