GithubHelp home page GithubHelp logo

chatbot's Introduction

GPT-powered Discord bot for my own server.

poetry install
python cli.py sync-commands
python cli.py run

Commands

  • /chat — Start a conversation with the bot. It will create a new thread for you.
  • /ask — Ask the bot a one-shot question in the current channel.
  • /regenerate — In an existing thread, regenerate the bot's last response.
  • /stats — In an existing thread, show info such as tokens used and the Chat Completion API request payload.

Features

Multiple participants

The bot listens to other users' messages, including those from other bots and Discord.

Threads created by the bot are private. To invite other users, simply mention them in the thread.

The bot will never respond to messages that begin by mentioning another user (like how tweets that begin with @ were considered conversations between two users).

In the request, messages from other users will look like:

{
  "role": "user",
  "content": "<@user_mention> says: Hello, ChatGPT!"
}

Messages from Discord will look like:

{
  "role": "system",
  "content": "Discord: <@bot> added <@user> to the thread"
}

Rich content

Text attachments will have their content included.

Embeds are sent as Markdown documents, for example:

---
source: The New York Times <https://www.nytimes.com/>
author: By Noam Chomsky, Ian Roberts and Jeffrey Watumull
url: https://www.nytimes.com/2023/03/08/opinion/noam-chomsky-chatgpt-ai.html
type: article
---

**Opinion | Noam Chomsky: The False Promise of ChatGPT**

The most prominent strain of A.I. encodes a flawed conception of language and knowledge.

Response timing

Use the response_timing option to control when the bot will respond: after every message or only when the bot is mentioned.

Use the respond_to_bots option to control whether the bot will respond also after new messages from other bots.

Presets

By default, the following system message is included at the beginning the request:

{
  "role": "system",
  "content": "Your name is {bot_name}. You are talking to {user} over Discord. Server name: {server}. Channel: {channel}"
}

Use the preset option to choose other presets, or use the system_message option to write your own.

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.