GithubHelp home page GithubHelp logo

cedd82 / gptdiscordbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omgitsjan/starter-discordbotai

0.0 0.0 0.0 63 KB

This is a simple Discord bot that uses the OpenAI ChatGPT API to generate responses to messages in a Discord chat. The bot is written in C# and uses the Discord.Net library to interact with the Discord API and the RestSharp library to make HTTP requests to the OpenAI API.

License: MIT License

C# 100.00%

gptdiscordbot's Introduction

Discord Bot (with OpenAI [ChatGPT & DALL-E])

This is a simple Discord bot that uses the OpenAI ChatGPT API to generate responses to messages in a Discord chat. The bot is written in C# and uses the Discord.Net library to interact with the Discord API and the RestSharp library to make HTTP requests to the OpenAI API.

Installation

To use this bot, you will need the following:

  • A Discord bot token
  • An OpenAI ChatGPT API key

Once you have these, you can clone this repository and build the project using the dotnet command, like this:

Copy code

git clone https://github.com/omgitsjan/DiscordBot cd DiscordBot dotnet restore dotnet build

Next, you need to specify the environment variables for the Discord bot token and ChatGPT API key when starting the bot. For example:

Dont forget to change the static variables in Program.cs and OpenAiService.cs.

Replace DiscordToken and ChatGptApiKey with your actual Discord bot token and ChatGPT API key, respectively.

Usage

To use the bot, send a message in the form of !chat <message> or !image <message> where <message> is the text you want the bot to generate a response for. For example:

ChatGPT:

!chat What is the meaning of life?

DALL-E:

!image Pixel art where monkeys trying to rob a bank

The bot will respond with a generated image/text response based on the prompt you provided.

License

This project is licensed under the MIT License. See LICENSE for details.

gptdiscordbot's People

Contributors

omgitsjan 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.