Skip to content

ashiven/discord-gpt

Repository files navigation

License: MIT GitHub Release GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub Repo stars

About

This is a Discord bot that was written with Poise to enable users to have simple interactions with ChatGPT without having to use the website.

Getting Started

Prerequisites

  • Download and install the latest version of Rust.
  • Register for an OpenAI API key and retrieve it.
  • Create a new Discord bot and retrieve a token for it.

Setup

  1. Clone the repository to your local machine as follows:

    git clone https://github.com/ashiven/discord-gpt.git
  2. Navigate to the discord-gpt directory.

    cd ./discord-gpt
  3. Set the OpenAI API key and Discord bot token environment variables or add them to a .env file.

    export OPENAI_API_KEY="your api key" DISCORD_TOKEN="your discord token"

Usage

  • Enter the following command to start the bot:

    cargo run --release

Interactions

  • ~chat to have a regular conversation with the bot that maintains its context.

    User: ~chat My favorite color is blue.
    
    Bot: That is very interesting!
    
    User: ~chat What is my favorite color?
    
    Bot: Your favorite color is blue.
    
  • ~summarize to get a brief summary of your message.

    User: ~summarize *Long and complicated text*
    
    Bot: The key points of the text are the following: ...
    
  • ~session 10 [goals] to start a 10 minute pomodoro working session, optionally telling the bot about your goals for this session.

    User: ~session 10 Learn how to build an http server in python.
    
    Bot: Your 10 minute session has been running for: 
    
         0m : 39s
    
    Bot: 🍅🎉 Time's up! Your 10-minute pomodoro session has come to an end. It's break time! 🌟
    
         Did you manage to build the HTTP server in Python during this short session?
         If not, would you like some help to achieve it in the next one?
    
         Here's a cute animal video to brighten your break: Funny Animal Video
    

GitHub @ashiven  ·  Twitter ashiven_

About

ChatGPT in a Discord bot

Topics

Resources

License

Stars

Watchers

Forks

Languages