Skip to content

Deploying Without A Reverse Proxy Server

Warning

This is not recommended unless your cloud provider/deployment service provides this already.

Sample Bot File

from dispike import Dispike

bot = Dispike(...)

Running directly from the bot.

from dispike import Dispike

bot = Dispike(...)

# Bind port to something higher if you run into problems with root.
bot.run(bind_to_ip_address="0.0.0.0", port=443)

Running bot with Uvicorn

Installing Uvicorn

$ pip install uvicorn[standard]
---> 100%

Running the bot on a specific port + allowing outside connections.

$ uvicorn file_containing_bot:bot.referenced_application --host 0.0.0.0 --port 444 --ssl-keyfile=./key.pem --ssl-certfile=./cert.pem
<span style="color: green;">INFO</span>:     Uvicorn running on http://0.0.0.0:443 (Press CTRL+C to quit)

.referenced_application is extremely important.

You may want to read Uvicorn's documentation for more keyword arguments or to deploy with Gunicorn instead.

Running bot with Hypercorn

$ pip install hypercorn
---> 100%

Running the bot on a specific port + allowing outside connections.

$ hypercorn file_containing_bot:bot.referenced_application --bind 0.0.0.0:443
Running on 0.0.0.0:8080 over http (CTRL + C to quit)

.referenced_application is extremely important.