This Discord bot allows users to control relays via serial communication with a microcontroller. The bot is built using the discord.py library and communicates with the microcontroller using the pyserial
library.
Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)
- Relay Control: Turn on/off relays via Discord commands.
- Help Command: Provides a list of available commands and their functions.
- Python 3.8+
- discord.py library
- pyserial library
- Microcontroller with relays connected to the serial port
-
Clone the Repository
git clone https://github.com/suragaru/Arduino_Discord_Bot.git cd discord-relay-bot
-
Install Dependencies
pip install discord.py pyserial
-
Set Up the Bot Replace
"DISCORD_TOKEN_HERE"
with your bot's token in theclient.run("DISCORD_TOKEN_HERE")
line. -
Run the bot
python bot.py
- After the bot works, modify the script if you want to add more functions to the bot.
The bot sends commands to the microcontroller via the serial port specified in the code (COM3 in this case). Make sure to update the serial port according to your system's configuration.
Feel free to fork this project and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
You can check out the full license here
This project is licensed under the terms of the MIT license.