This has a fatal flaw, the Cloudflare DDOS protection doesn't allow the script through to examine the page :(
This is a Discord bot that checks the status of the ChatGPT website. If the site is down it will send a message to a specific channel. If the site comes back up, it will send another message to the channel.
-
Clone the repository to your local machine.
git clone https://github.com/YOUR-USERNAME/Discord-Webpage-Monitor-Bot.git
-
Create a new Discord bot and invite it to your server. This guide provides step-by-step instructions on how to do this.
-
Create a new file named .env in the root directory of the cloned repository. This file should contain one line that specifies the Discord bot token, like so:
DISCORD_TOKEN=YourToken
Make sure to replace YourToken with your actual bot token.
-
Install the required dependencies by running
pip install -r requirements.txt
-
Modify the script by replacing the
channel_id
variable with the ID of the channel in your server where you want to send messages. -
Run the script by executing the following command in the terminal
python bot.py
- The bot will check the webpage every 30 seconds and send a message to the specified channel if the specified string is found or not found.
- Error handling, if any error occurs in the process of requesting the webpage, it will send a message to the specified channel with the error.
- Uses the dotenv library to load the Discord bot token from a .env file, allowing you to keep your token secure and not hardcoded in the script.
Please note that the extension and the example server are provided as-is and are intended for educational and informational purposes only. The author is not affiliated with OpenAI and claims no responsibility for any damages that may occur as a result of using the software. The software is provided under the MIT License.
Feel free to fork this repository, improve the code and submit a pull request.
Please note that this is a simple example, it can be improved for a production setting. I recommend testing this script in a development environment before using it in production.