Giter VIP home page Giter VIP logo

jarylc / cf-workers-bingai-sydney-discord-bot Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 153 KB

Synced from GitLab - Deploy your own Serverless Discord bot integration to quickly interface with Bing's AI (a.k.a Sydney) using their reverse engineered API

Home Page: https://gitlab.com/jarylc/cf-workers-bingai-sydney-discord-bot

License: MIT License

TypeScript 88.92% JavaScript 11.08%
bing bingai bot chat chatbot chatgpt discord sydney

cf-workers-bingai-sydney-discord-bot's Introduction

cf-workers-bingai-sydney-discord-bot

Logo

Description

Example

Serverless Discord bot in webhook mode to quickly interface with BingAI a.k.a Sydney's using a reversed engineered API.

This is much slower than ChatGPT variants as there is no way to disable streaming mode (words generate one at a time) and I have to capture when the stream ends.

Note: This is mainly for personal use, if you would like to add features, do fork the repository. Do perform PRs back if you would be so kind!

Prerequisites

Getting Started

Wrangler

  1. Sign in to https://www.bing.com/ on the browser
  2. Clone this repository
  3. Run npm ci or yarn install
  4. Replace {DISCORD_TOKEN} and {DISCORD_APPLICATION_ID} in the following DISCORD_TOKEN={DISCORD_TOKEN} DISCORD_APPLICATION_ID={DISCORD_APPLICATION_ID} npx node src/register.js and run it to register the bot commands
  5. Run npx wrangler secret put DISCORD_APPLICATION_ID and set the Discord app's ID
  6. Run npx wrangler secret put DISCORD_PUBLIC_KEY and set the Discord app's public key
  7. Run npx wrangler secret put DISCORD_TOKEN and set the Discord bot's token
  8. Run npx wrangler secret put BING_COOKIE and set your latest Bing cookie request header on https://edgeservices.bing.com/edgesvc/turing/conversation/create
  9. Add space-delimited user IDs to whitelist in DISCORD_USERID_WHITELIST in wrangler.toml
  10. (Optional) To enable context, run npx wrangler kv:namespace create session and replace the ID of BINGAI_SYDNEY_DISCORD_BOT_KV wrangler.toml, else remove kv_namespaces block entirely from wrangler.toml
  11. (Optional) Choose your BING_CONVERSATION_STYLE by commenting and uncommenting accordingly in wrangler.toml
  12. (Optional) Update BING_BEHAVIOR in wrangler.toml with your desired behavior / system message
  13. Run npx wrangler publish to deploy to Cloudflare Workers
  14. Set the Interactions Endpoint URL of your Discord application to the URL of the deployed worker

(On cookie expiry, roughly 2 weeks) Renewing BING_COOKIE

  1. Sign in to https://www.bing.com/ on the browser
  2. Run npx wrangler secret put BING_COOKIE and set your latest Bing cookie request header on https://edgeservices.bing.com/edgesvc/turing/conversation/create

cf-workers-bingai-sydney-discord-bot's People

Contributors

jarylc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.