Question:
Short say , i want my Bot running 24/7 and got always a Error if i want to Deploy it. The Bot work perfect.
Repl link/Link to where the bug appears:
import re
import os
import discord
from discord.ext import commands
import os
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print("Bot is ready")
@bot.command()
async def ping(ctx):
await ctx.send('Pong!')
@bot.command()
async def repeat(ctx, *, text):
await ctx.send(text)
@bot.event
async def on_message(message):
if message.author.bot:
return
coordinates = re.findall(r'\d+\.\d+', message.content)
if coordinates:
await message.channel.send(f'<https://google.com/maps?q={",".join(coordinates)}>\n<https://cuno.bot/dplnk?{",".join(coordinates)}>')
await bot.process_commands(message)
token = os.environ['Token']
bot.run(token)
What i get:
hostingpid1: an open port was not detected
[2023-10-13 22:51:02] [INFO ] discord.gateway: Shard ID None has connected to Gateway.