This repo demonstrates how to create a server bot for the Poe platform using a WSGI Python web application.
A functioning instance of this bot is available on Poe as Server-Bot-WSGI (by @robhewitt).
- Synchronous (no async): The bot is implemented using synchronous Python, making it compatible with standard WSGI-based web hosting environments (no need for VPS or cloud services such as Modal, etc).
- Flask-based: Built using the Flask microframework to handle HTTP requests and responses.
- Logging: Logs requests and responses for easier debugging and monitoring.
- Chat Relay: Forwards user messages to a third-party bot on Poe and relays the responses back.
- Extensible: Use this codebase as a starting point for your own server bot project. Suitable for experimentation and light traffic scenarios.
To host this project, you'll need a Python web application setup, which is often available on shared hosting platforms like cPanel.
- Log into your hosting provider's control panel (e.g., cPanel) and navigate to "Setup Python App".
- Click "Create Application".
- Select the latest version of Python (3.x).
- Set the Application root to
poe-bot-server
. - Set the Application URL to
poe-bot-server
. - Leave the Application startup file and Application Entry point fields blank for now.
- Click "Create" to initialize the app.
- Open your browser and visit
https://yourdomain.com/poe-bot-server/
to confirm that the default web app setup is running. - Use the File Manager in cPanel to navigate to the
/poe-bot-server
directory. - Replace the existing files in this directory with the project files from this repository.
- Return to "Setup Python App" and click "Edit" to view your app's details.
- Copy the command provided to enter the virtual environment and run it via SSH (e.g., using PuTTY).
- Within the SSH session, run
pip install -r requirements.txt
to install the necessary dependencies. - Restart your Python web app to apply the changes.
- Revisit
https://yourdomain.com/poe-bot-server/
to check if the updated app is running. - Note: Before your bot can function, you'll need to configure the
.env
file. This requires completing Part 2.
To link your web app to Poe, you need to create a server bot profile.
- Log into your Poe account.
- Click "Create bot" or navigate to poe.com/create_bot.
- Select "Server bot".
- Choose a unique name for your bot.
- Enter your server's URL (e.g.,
https://yourdomain.com/poe-bot-server/
) under Server URL. - Copy the access key provided by Poe.
- Update the
.env
file in your web app directory with the bot name and access key. - Click "Check reachability" to test the connection between Poe and your web app. If there are issues, try restarting the app.
- Once the connection is successful, click "Create bot".
- Start a chat with your new server bot on Poe to see it in action!
This project is licensed under the MIT License - see the LICENSE file for details.