Giter VIP home page Giter VIP logo

pyroedgegptbot's Introduction

PyroEdgeGPTBot

A telegram bot with Bing AI ( using EdgeGPT API )

English - δΈ­ζ–‡

Features

  • Multiple users with different sessions (No group support now)
  • Response with reference (and correct ref label)
  • Response with normal and stream mode
  • Can allow every one to use
  • Allow you set your own cookie at runtime
  • Allow you set a bot name to you
  • Prompt Support
  • Image generation (inline query and command mode)
  • Export conversation to Notion
  • Hot update the EdgeGPT dependence

Setup

Requirements

Checking bing AI access (Required)

PS: Everyone can access Bing AI for chat now, even anonymous users.

  • Install the latest version of Microsoft Edge
  • Alternatively, you can use any browser and set the user-agent to look like you're using Edge. You can do this easily with an extension like "User-Agent Switcher and Manager" for Chrome and Firefox.
  • Open bing.com/chat
  • If you see a chat feature, you are good to go

Getting authentication (Optional)

PS: This column is needed by image creator, or ask more questions and have longer conversations

  • Install the cookie editor extension for Chrome or Firefox or Edge
  • Go to bing.com
  • Open the extension
  • Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard)
  • Paste your cookies into a file ./cookie.json (The filename depends on your .env settings)

Install requirements

pip install -r requirements.txt

Set environment variables

cp .env.example .env

Then edit .env file and set API_ID, API_KEY, BOT_TOKEN and ALLOWED_USER_IDS. Or you can set environment variables like this:

export API_ID='1234567'
export API_KEY='abcdefg2hijk5lmnopq8rstuvwxyz9'
export BOT_TOKEN='123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'
export ALLOWED_USER_IDS='112113115,567568569'

Run

python PyroEdgeGptBot.py

Run it on Back4app

  • Fork this repo
  • Login into Back4app (Suggests login with github account)
  • Click Build new app and Containers as a Service
  • Link the repo you forked.
  • Set the Required ENVS (Explain here)

Note that you can run python base64_encode_cookie.py locally then get COOKIE_BASE64 value from base64_encoded_cookie.txt

  • Deploy!

Run it on Railway (Recommend)

Deploy on Railway

(Optional) Set bot commands

  • Contact @botfather
  • Send /mybots then select your bot and click Edit Bot -> Edit Commands
  • Paste below and send.
start - Start the bot!
help - Get help
reset - Reset the bot
new - Create new conversation
switch - Switch the conversation style
interval - Set edit interval
suggest_mode - Set the suggest mode
image_gen - Generate images
update - Update the EdgeGPT dependence
cookie - Set you own cookie
bot_name - Set the bot name display to you

pyroedgegptbot's People

Contributors

hebijush avatar tom-snow avatar yorddyyorddy 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.