1

I'm coding within replit and it just says this

WARNING: This is a development server. Do not use it in a production deployment.

  • Running on (my IP-not showing it in this but it says my ip) (Press CTRL+C to quit)
import discord
import os
from keep_alive import keep_alive 
client = discord.Client()

@client.event
async def on_ready():
   print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
   if message.author == client.user:
       return

   if message.content.startswith('$hello'):
       await message.channel.send('Hello!')

keep_alive()


token=(removed my token for privacy)
Alex Waygood
  • 6,304
  • 3
  • 24
  • 46
Whatic
  • 11
  • 4

1 Answers1

0

I know the source of this question, so can help you here. To keep your bot alive , the author is using a flask server as a workaround so replit does not stop the execution of the python program/bot.

By default,Flask server is not a prod server , its lightweight server; so when you put flask app on prod it's through WSGI server. You can refer to more content if you search like "Deploy flask app to" and you will see various options to explore.

A quick reference would be flask-safe-to-use-in-production .

simpleApp
  • 2,885
  • 2
  • 10
  • 19