Below is the finished code you provided, with some fixes and minor adjustments to ensure smooth operation and maintainability. Please ensure to replace `YOUR_DISCORD_BOT_TOKEN` and `YOUR_GUILD_ID` with your actual Discord bot token and guild ID.
Make sure to install the necessary libraries before running this code (if you haven't already):
```bash
pip install discord.py pyautogui psutil
```
Here’s the complete code:
```python
import tkinter


