Giter Club home page Giter Club logo

telegram-gpt's Introduction

A Telegram ChatGPT bot

flows.network Discord flows.network Twitter Create a flow

Deploy this function on flows.network, and you will get a Telegram bot that uses ChatGPT to respond to every question in your Telegram DM or channel/group automatically.

image

The example in the above image is to leverage ChatGPT to generate code comments.

Prerequisites

  • You will need to bring your own OpenAI API key. If you do not already have one, sign up here.

  • You also need a bot token to access the Telegram API. If you don't already have one, go to Telegram to get a bot token from @botfather.

Deploy a ChatGPT Telegram bot

To install the ChatGPT Telegram App, we will use flows.network, a serverless platform that makes deploying your own app quick and easy in just three steps.

Prepare the code: fork this repo

Fork this repo and go to flows.network to deploy your function.

Deploy the code on flow.network

  1. Log into flows.network from your GitHub account. It's free.

  2. Click on the "Create a Flow" button to start deploying the ChatGPT GitHub APP

  3. Authenticate the flows.network to access the telegram-gpt repo you just forked. image

  4. Click the Advanced test to see more settings. Here we need to use Environment Variables to pass the Telegram token and OpenAI API key name.

  • telegram_token: Fill in the token you received from Fatherbot.
  • openai_key_name: Fill in the name you want for your OpenAI key. You can put any name here, and we will connect it to the actual key later.

image

  1. Click on the Deploy button to deploy your function.

Configure SaaS integrations

After that, the flows.network will direct you to configure the SaaS integration required by your flow. Since we have configured Telegram in the above step, OpenAI is the only SaaS we need to configure here.

image

Click the "Connect/+ Add new authentication" button to add your OpenAI API key. On the next page, copy and paste your OpenAI API key and then name the key. Note the name you enter here should be the same as the name in the environment variable.

image

Give it a try.

Click on the Check button to see your flow details. As soon as the flow function's status becomes ready and the flow's status becomes running, the Telegram ChatGPT App goes live. Go ahead and send a private message to the bot! You can also invite this bot to your channel/group.

Dev notes

If you want to build locally, make sure you have installed Rust and added the wasm32-wasi target.

cargo build --target wasm32-wasi --release

telegram-gpt's People

Contributors

juntao avatar alabulei1 avatar vinilanzoni 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.