Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.38 KB

README.md

File metadata and controls

34 lines (27 loc) · 1.38 KB

AIBot

Boilerplate discord.py + openAI bot w/ sqlite3 for customizable bots that you can easily run.

It is automatically setup to save message history (per-user) in a sqlite database.

Running the Bot:

  1. Create a .env file with your OpenAI & Discord Bot tokens. Example .env content (these are fake keys/tokens):
OPENAI_API_KEY=sk-3242hksdghrekug34gkfhrgeeriguh
DISCORD_TOKEN=MWY3ZjY4ZDhjNjllMGYzZj.g4OGM3NjYzMWNlNTc1ZjVmZDNiZGFmNzQy.N2E4MWQxZWVjZDRiYjFhYzAzNjhiZA==
  1. Customize the starting bot prompt in prompt.py For instance:
intro =  [
    ("system", "You are a Discord Bot that should translate messages from english to morse code.", 0),
    ("user", "hello there", 0),
    ("assistant", ".... . .-.. .-.. --- / - .... . .-. .", 0)
]

Then you can run the bot in python via: python3 bot.py

For continuous deployment on a linux server, I'd recommend using a systemd service but frankly any solution you prefer also works.

References