Coder Social home page Coder Social logo

openai-telegram-bot's Introduction

openai-telegram-bot

openai telegram bot for private messages & groups

Update 2023/03/02

Try new official chatgpt api doc:

It's 1/10 cheaper than text-davinci-003 model.

# run this command and wait for the browser window.
node turbo.js

Notice

The bot using two kinds of APIs from OpenAPI official & chatGPT web api.

liveChat.js for simulating the chatgpt website live reply in telegram.

turbo.js for newest gpt-3.5 official chatgpt API.

index.js for OpenAPI official api using text-davinci-003 model —— reliable but expensive.

chat.js for reverse engineered chatGPT web api —— free but slow & may get to network issues.

server.js turn chatGPT into your own api service.

Usage

git clone https://github.com/discountry/openai-telegram-bot.git
cd openai-telegram-bot

npm i

cp .env.example .env

# edit .env with your token and api key
vim .env

# test
node index.js

# run in background
npm install -g pm2

pm2 start index.js

chat.js

# test
node chat.js

# use chatgpt api when you run out of money
pm2 start chat.js

server.js

# test
node server.js

# use chatgpt api as a web service that you can access from url
pm2 start server.js

# goto http://localhost/chat/:userId/:message example: http://localhost/chat/1/hello

Interactions

/ask

ask normal questions or let the bot write code for you.

/ask how old are you

/fix

get grammer and typo fix.

/fix he am dgo

/image

get image reply from dalle2 model.

/image doge with twitter to the moon

/reload

reload chat history. The bot will forget everything.

/reload

openai-telegram-bot's People

Contributors

discountry 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

Watchers

 avatar  avatar  avatar  avatar  avatar

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.