Skip to content

A Discord bot running natively on an ESP32 using WebSockets. Displays status updates on an SSD1306 OLED screen.

License

Notifications You must be signed in to change notification settings

pingvortex/ESP32-Discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

ESP32 Discord Bot Host

A native Discord bot running on an ESP32 using WebSockets. This project allows you to host a functional Discord bot on a microcontroller without needing a 24/7 PC or a VPS. It also features optional real-time status updates on an SSD1306 OLED display.

Note

This project has been developed and tested specifically on the ESP32 DevKit V1. While it may work on other ESP32 variants, pin layouts and compatibility have not been verified.

Features

  • Native WebSockets: Connects directly to the Discord Gateway (v10).
  • Command Handling: Supports basic interactive commands.
  • OLED Integration: Displays bot status, connectivity, and command logs on a 128x64 I2C screen.
  • Low Power: Efficiently handles heartbeats and message parsing via ArduinoJson.

Hardware Requirements

  • ESP32
  • SSD1306 128x64 I2C OLED (Optional)

What did I exactly use?

  • ESP32 DEVKIT V1 (ESP-WROOM-32)
  • IIC I2C OLED display 0,96" - White, 128 x 64

Bot Commands

  • >:test - Checks if the bot is responding and see some stats.
  • >:ping - Measures the latency of the ESP32.
  • >:echo <channel_id> <message> - Makes the bot echo a text you say in a chosen channel.
  • >:flip - Flips a coin.
  • >:rng <min> <max> - Generate a random number in a chosen range.

Setup Instructions

  1. Discord Developer Portal:
  • Create a new application and get your Bot Token.
  • Enable Message Content Intent in the "Bot" settings tab.
  1. Configuration:
  • Open the config.h file and update the following variables:
  • token: Your Discord Bot Token.
  • wifiName: Your WiFi SSID.
  • wifiPassword: Your WiFi Password.
  • botName: What name do you want displayed on the OLED.
  1. Wiring:
  • VCC -> 3.3V
  • GND -> GND
  • SCL -> GPIO 22
  • SDA -> GPIO 21
  1. Flash: Select your ESP32 board in Arduino IDE and upload the sketch.

License

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 (CC BY-NC-SA 4.0)

About

A Discord bot running natively on an ESP32 using WebSockets. Displays status updates on an SSD1306 OLED screen.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published