Skip to content

CozmycDev/discord-python-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Discord Bot

This is a simple example of a Discord bot implemented in Python using dotenv-python for managing sensitive keys, py-cord for interacting with the Discord API, and cogwatch for dynamic cog reloading.

This repo can be forked and modified to include unlimited capabilities and features; from complex view-flows, modals, MySQL, anything!

Features

  • Loads Discord token and other sensitive keys from a .env file.
  • Loads less sensitive configuration from bot_config.json
  • Implements a single slash command example, /ping
  • Utilizes cogwatch for hot-reloading modules in the cogs sub-directory.

Requirements

Installation

  1. Clone the repository:

    git clone https://github.com/cozmycc/PythonDiscordBot.git
    cd PythonDiscordBot
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up your .env file:

    Create a file named .env in the root directory of your project, if it doesn't already exist, and add the following:

    DISCORD_TOKEN=your_discord_token_here

Usage

  1. Run the bot:

    python bot.py
  2. Interact with the bot:

    Use the slash command /ping in your Discord server where the bot is present to verify it is working.

Example Configuration

bot_config.json

{
  "main": {
    "version": "1.0.0"
  }
}

About

Simple Discord bot example using Pycord

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages