Skip to content

chriscummings/pbot3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pBot

Version 0.1.31

Warning: This project is pre version 1!

Development

Application Structure

pBot is broken into 3 services.

  • Admin - web UI for bot administration and experimentation (see sandbox).
  • Listener - handles interactions with discord. Collects incoming messages, sends any responses.
  • Bot - the bot proper. Evaluates messages. Conditionally makes calls to AI.
                             ┌──────────┐
                             │ Discord  │
                             └──────────┘
                                   ▲
               ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┼ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
                Docker             ▼
               │              ┌────────┐               │
                              │Listener│
               │              │Service │               │
                              └────────┘
               │                   ▲                   │
┌──────────┐                       │
│  OpenAI  │◀─┐│  ┌────────┐       ▼       ┌────────┐  │
└──────────┘  │   │  Bot   │    ┌─────┐    │ Admin  │
              ├┼─▶│Service │◀──▶│Redis│◀──▶│Service │  │
┌──────────┐  │   └────────┘    └─────┘    └────────┘
│Midjourney│◀─┘│                                       │
└──────────┘    ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

Model Structure

.

Dependencies

Python

Dependency Admin Service Bot Service Listener Service
discord
Flask
openai
pylint
pytest
python-dotenv
ratelimit
tiktoken
redis-py

Front-End

Dependency Admin Service Bot Service Listener Service
Bootstrap 5

Contributing

Fork & submit a pull request. I'll try to reply quickly. 🙏

Design Philosophy

While there is stil much to do, pBot is meant to be a simple bot framework on which you can experiment and build. Dependencies and patterns have been chosen to this end. Always keep the novice developer in mind. As tempting as it might be to write clever code, doing so probably wont do newer developers any favors.

Code Quality

  • Write code for humans first, machines second.
  • Comments should explain why, not how.
  • Code should be written as self-documenting as possible.
  • Code should have tests behind it and those tests must pass!
  • Pylint should pass 100%. You can ignore a rule if there is a good reason (dependency causes ignorable issue) but document why.

Helpful Third Party Documentation

OpenAI

Discord

Midjourney

Future Bard Stuff

Misc.

TODO:

  • Handle a monthly token allotment. Ration AI responses for both openai and midjourney.
  • Image "mirroring"
  • More robust multi-call decision making?
  • rate limiting
  • Incite chaos!
  • document invoke usage

About

A Dockerized, GPT assisted, mean-spirited Discord bot. Incite chaos!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published