Giter VIP home page Giter VIP logo

culturedswines-bot's Introduction

Discord Chat Bot with ChatGPT

This is a Discord chat bot implemented in Rust using the Serenity library and the ChatGPT language model provided by OpenAI. The bot is capable of engaging in conversations with users, answering questions, and providing various functionalities.

Features

  • Responds to user messages with the help of ChatGPT, a powerful language model.
  • Handles commands starting with a specific prefix.
  • Roasts users and provides clever and witty replies.
  • Persists conversation history for each user in JSON format.
  • Supports token-based system for rewards and penalties.

Prerequisites

  • Rust programming language and Cargo package manager installed.
  • Discord bot token (obtainable from the Discord Developer Portal).
  • OpenAI API key for ChatGPT access.

Installation

  1. Clone the repository:
git clone https://github.com/Samarth1696/CulturedSwines-Bot.git
  1. Change into the project directory:
cd CulturedSwines-Bot
  1. Install the dependencies and run the project using Cargo shuttle:
cargo shuttle run

Configuration

  1. Create a Secrets.toml file in the project directory.

  2. Add the following entries to the Secrets.toml file:

DISCORD_TOKEN = "<your_discord_bot_token>"
API_KEY = "<your_openai_api_key>"

Replace <your_discord_bot_token> with your actual Discord bot token and <your_openai_api_key> with your OpenAI API key.

Commands

The bot responds to messages starting with a specific prefix, which is set to ! by default. Simply write any message with ! as the prefix and you will get the response.

Conversation and History

The bot maintains a conversation history for each user in JSON format. The history is stored in separate files named <username>.json. The conversation history is used to provide context and improve the quality of responses.

License

This project is licensed under the MIT License.

Disclaimer

This project is a proof-of-concept and should be used responsibly. The use of ChatGPT and its responses should comply with OpenAI's content policies and guidelines. OpenAI's content policies apply even if the bot claims to "do anything now".

culturedswines-bot's People

Contributors

samarth1696 avatar

Watchers

 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.