Giter VIP home page Giter VIP logo

chatgpt-telegram-bot's Introduction

ChatGPT Telegram bot

Run your own ChatGPT Telegram bot!

Setup

  1. Get your OpenAI API key

    You can create an account on the OpenAI website and generate your API key.

  2. Get your telegram bot token

    Create a bot from Telegram @BotFather and obtain an access token.

  3. Install using go install

    If you have a Go environment, you can install it with the following command:

go install github.com/leafduo/chatgpt-telegram-bot@latest
  1. Install using binary

    You can get prebuilt binaries from GitHub Releases and put it in $PATH

  2. Install using Docker-compose

    Check out docker-compose.yml for sample config

  3. Set the environment variables and run

export OPENAI_API_KEY=<your_openai_api_key>
export TELEGRAM_APITOKEN=<your_telegram_bot_token>
# Optional, default is empty. Only allow these users to use the bot. Empty means allow all users.
export ALLOWED_TELEGRAM_ID=<your_telegram_id>,<your_friend_telegram_id>
# Optional, default is 1.0. Higher temperature means more random responses.
# See https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
export MODEL_TEMPERATURE=1.0
# Optional, default is 900. Max idle duration for a certain conversation.
# After this duration, a new conversation will be started.
export CONVERSATION_IDLE_TIMEOUT_SECONDS=900
# Optional, defaults to gpt-3.5-turbo. Specify which model to use.
# Currently, only `gpt-3.5-turbo` and `gpt-4` are supported.
export OPENAI_MODEL=gpt-3.5-turbo
# Optional, defaults to https://api.openai.com.
# You can use this to set a custom OpenAI API endpoint to use third party relay services like https://api2d.com/.
export OPENAI_BASE_URL=https://api.openai.com

chatgpt-telegram-bot

chatgpt-telegram-bot's People

Contributors

dependabot[bot] avatar ethinx avatar leafduo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chatgpt-telegram-bot's Issues

Conflict: terminated by other getUpdates request; make sure that only one bot instance is running

2023/03/06 11:34:29 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:34:36 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:34:36 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:34:42 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:34:42 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:34:49 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:34:49 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:34:56 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:34:56 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:02 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:02 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:09 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:09 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:16 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:16 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:22 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:22 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:29 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:29 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:35 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:35 Failed to get updates, retrying in 3 seconds...
2023/03/06 11:35:42 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2023/03/06 11:35:42 Failed to get updates, retrying in 3 seconds...

Hi there..

I run the bot with: "GO RUN MAIN.GO" and got this:

panic: Not Found

goroutine 1 [running]:
main.main()
/usr/local/chatgpt-telegram-bot/main.go:42 +0xd66
exit status 2

Go i guess it's installed
──(root㉿kali)-[/usr/local/chatgpt-telegram-bot]
└─# go version
go version go1.20.1 linux/amd64

Can you help?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.