Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ranitmanik/mygpt

This is an amazing Discord Bot powered by ChatGPT that has been designed to enhance your chatting experience. With its advanced capabilities, this bot is capable of engaging in meaningful conversations and providing you with a truly interactive and enjoyable chat environment.
https://github.com/ranitmanik/mygpt

chat chatbot chatgpt chatgpt-api chatgpt-bot chatgpt3 discord discord-bot gpt openai

Last synced: about 2 months ago
JSON representation

This is an amazing Discord Bot powered by ChatGPT that has been designed to enhance your chatting experience. With its advanced capabilities, this bot is capable of engaging in meaningful conversations and providing you with a truly interactive and enjoyable chat environment.

Awesome Lists containing this project

README

        



myGPT Discord Chatbot


Welcome to the comprehensive setup guide for myGPT, an exceptional and highly efficient personal Discord chatbot that harnesses the immense power of OpenAI's cutting-edge GPT-3.5 Turbo model. With this guide, you will be taken on a step-by-step journey that encompasses not only the installation process but also the crucial configuration steps that are vital in ensuring the seamless and optimal functioning of your exceptional chatbot. Prepare to witness the incredible capabilities of myGPT as it springs to life and transforms your Discord experience into something truly extraordinary.

## Table of Contents
- [Introduction](#introduction)
- [Features](#features)
- [Installation](#installation)
- [Clone the Repository](#1-clone-the-repository)
- [Install Required Packages](#2-install-required-packages)
- [Usage](#usage)
- [Create a Discord Bot](#1-create-a-discord-bot)
- [Invite the Bot to Your Discord Server](#2-invite-the-bot-to-your-discord-server)
- [Create an OpenAI Account](#3-create-an-openai-account)
- [Access the OpenAI API Section](#4-access-the-openai-api-section)
- [Create a New API Key](#5-create-a-new-api-key)
- [Save and Run](#6-save-and-run)
- [Verify Functionality](#7-verify-functionality)
- [Configuration](#configuration)
- [Chat Files](#chat-files)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
- [Acknowledgment](#acknowledgment)

## Introduction

**myGPT** is a Discord chatbot powered by OpenAI's GPT-3.5 Turbo model, created using Python. It reads messages from a specified chat file and responds to mentions in Discord using the GPT-3.5 Turbo model.

## Features

- Seamless integration with Discord
- Configurable chat file selection
- Utilizes OpenAI GPT-3.5 Turbo for natural language understanding
- Easy-to-use and extendable

## Installation

### 1. Clone the Repository

```bash
git clone https://github.com/RanitManik/myGPT
```

### 2. Install Required Packages

```bash
pip install -r requirements.txt
```

## Usage

### 1. create a Discord Bot

1. Create a Discord bot on the [Discord Developer Portal](https://discord.com/developers/applications).

2. Copy the bot token.

3. Replace `Your Discord Application Token Goes here` in the `.env` file with the actual bot token.

4. Visit the following link, replacing `` with your bot's client ID:

### 2. Invite the Bot to Your Discord Server

1. Create a Discord bot on the [Discord Developer Portal](https://discord.com/developers/applications).

2. Copy the bot token.

3. Replace `your_discord_bot_token` in the `.env` file with the actual bot token.

4. Visit the following link, replacing `` with your bot's client ID:

### 3. Create an OpenAI Account

1. Visit the OpenAI website: [https://beta.openai.com/](https://beta.openai.com/)

2. Sign up for an account if you don't have one. Follow the registration process.

### 4. Access the OpenAI API Section

1. Once you're logged in, navigate to the OpenAI API section.

- On the OpenAI dashboard, click on your account name in the top right corner.
- Select "API" from the dropdown menu.

### 5. Create a New API Key

1. In the API section, you'll find the option to create a new API key.

2. Click on the "Create API Key" button.

3. Give your API key a meaningful name related to your project (e.g., "RanitGPT").

4. Copy the generated API key. It will look something like this: `sk-xxxxxx-xxxxxxxxxxxxxx`.

5. Open the `.env` file in your RanitGPT project directory.

6. Replace the placeholder `Your openAI API key goes here` with the actual API key you obtained from OpenAI:

```plaintext
SECRET_KEY=your_discord_bot_token
OPENAI_API_KEY=sk-xxxxxx-xxxxxxxxxxxxxx
```

### 6. Save and Run

1. Save the changes to the `.env` file.

2. Now, when you run your RanitGPT bot, it will use the OpenAI GPT-3.5 Turbo model with the specified API key.

### 7. Verify Functionality

1. Trigger the bot on Discord (mention `@RanitGPT`).

2. Confirm that the bot is generating responses using the GPT-3.5 Turbo model.

By following these steps, you've successfully created an OpenAI GPT-3.5 Turbo API key and integrated it into your RanitGPT project. This key allows your bot to communicate with the OpenAI API and generate natural language responses.

## Configuration

You can configure the bot by modifying the following variables in `main.py`:

- `fileNumber`: Choose the chat file by setting this variable to 1, 2, or 3.
- `model`: Specify the GPT model to be used (default is "gpt-3.5-turbo").
- Adjust other parameters like `temperature`, `max_tokens`, `top_p`, `frequency_penalty`, and `presence_penalty` as needed.

## Chat Files

- `chats/chat1.txt`: [Sample chat file 1](chats/chat1.txt) — my resume
- `chats/chat2.txt`: [Sample chat file 2](chats/chat2.txt) — whatsapp chat bwtween me and my friend
- `chats/chat3.txt`: [Sample chat file 3](chats/chat3.txt) — a simple AI generated friends chat

## Contributing

1. Clone the repository:

```bash
git clone https://github.com/RanitManik/myGPT.git
```

2. **Add This repo as Remote**:

```bash
git remote add origin https://github.com/RanitManik/myGPT.git
```

3. **Create a New Branch** for your feature or bugfix:

```bash
git checkout -b feature/{your_feature} or bugfix/{issue_number}
```

4. **Commit** your changes:

```bash
git commit -m "Your meaningful commit message here"
```

5. **Push** your changes to the repository:

```bash
git push origin feature/{your_feature} or bugfix/{issue_number}
```

Feel free to contribute to the project by opening issues or pull requests. Any feedback or improvements are appreciated.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contact



Social Media
Username
Link



Email
[email protected]
Email



LinkedIn
Ranit Manik
LinkedIn



Instagram
ranit_manik_
Instagram



Facebook
RanitKumarManik
Facebook



Twitter
RANIT_MANIK
Twitter

## Acknowledgment

I want to express my gratitude to [CodeWithHarry](https://www.youtube.com/c/CodeWithHarry) for his insightful [tutorial on creating the myGPT Discord Chatbot](https://youtu.be/BP-w99ZINTc?si=tcUeGGh3MKCYODuk) using OpenAI's GPT-3.5 Turbo model, which served as a vital guide. Special thanks to contributors and the open-source community for enhancing the project. The inspiration behind myGPT arose from the need for an advanced Discord chatbot leveraging OpenAI's GPT-3.5 Turbo. For inquiries, feedback, or collaboration, feel free to contact me. Thank you for your support in making myGPT a valuable addition to the Discord community.

Happy Coding!