Coder Social home page Coder Social logo

lotka / gpt3-discord-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexistm/gpt3-discord-bot

0.0 0.0 0.0 92 KB

This a very basic discord bot linking to GPT3 (openai and AI21). By defaults it is Kirby, but can be any real or virtual bot (just need more or less training prompt).

Python 100.00%

gpt3-discord-bot's Introduction

OpenAI Discord bot

NOTE: More features are available in the Rust version: https://github.com/AlexisTM/discord-god-rust

This is an OpenAI discord bot replying as Kirby.

Environment keys:

  • OPENAI_KEY
  • AI21_API_KEY
  • DISCORD_BOT_TOKEN

Come and test on Discord!: https://discord.gg/Y8XPcj2Q

Commands

  • Kirby are you there?: Replies yes if the server runs
  • Kirby enable: Allow Kirby god to randomly jump into conversations (15% chance of reply)
    • Kirby disable: Disable the Kirby mode of the channel
  • Kirby god: : Answers as a Kirby god.
    • Remembers the 5 last prompts & answers
    • Clean the memory with Kirby clean
  • Marv: => Answers as a chatbot that reluctantly answers questions. Not maintained ;)

Installation

git clone https://github.com/AlexisTM/gpt3-discord-bot

cd gpt3-discord-bot
python3 -m pip install -r requirements.txt --user

export DISCORD_BOTOKEN="sometoken" 
export OPENAI_KEY="someothertoken"
export AI21_API_KEY="yetanothertoken"

python3 main.py

Notes:

  • You can directly speak to the bot for a direct chat to Kirby
  • The 5 message memory is over the same channel. I will eventually add the user name in the memory for more coherence.
  • AI21 is free with enough fun for a day, but is much less smart than OpenAI's version in my biased opinion.

Wow, Kirby is so funny

Technical help on how to make a Discord bot:

Create a bot application: https://discordpy.readthedocs.io/en/stable/discord.html

Configure intents for your bot: https://discordpy.readthedocs.io/en/stable/intents.html

In the oauth section of discord dev portal, make a link to allow your bot to join your server such as:

https://discord.com/api/oauth2/authorize?client_id=APPID&permissions=2215115840&scope=bot

In this case, we only need the bot scope and READ/WRITE messages permissions/

gpt3-discord-bot's People

Contributors

alexistm avatar lotka 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.