adamstirtan / discord_gpt_bot

A Discord bot in Python that responds to @ messages with the OpenAI API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

A Discord bot in Python that responds to @ messages with the OpenAI API for text completion.

๐Ÿ˜Ž Create virtual environment

python3 -m venv my_env

Now set the virtual environment as the current.

source my_env/bin/activate

๐Ÿ’พ Install libraries

pip install discord
pip install openai
pip install python-dotenv

๐Ÿ–ฅ๏ธ Set environment variables

Create a .env file in application root and set two values for the bot's API credentials:

DISCORD_TOKEN = your-token
OPENAI_KEY = your-key

๐Ÿš€ Start the bot

python3 bot.py

About

A Discord bot in Python that responds to @ messages with the OpenAI API


Languages

Language:Python 100.0%