Hello I cant understand this at all. I have no programming/hacker background. PLZZ help.
Deployment log
info: Deployment: f7c781b6-1a3a-49d2-ab5e-5879642544c7 - 2023-09-26T18:23:34.704Z
info: Build: d36374ff-5bb5-4616-855f-9bdd4bd175e6 - 2023-09-26T18:23:34.707Z
info: Connecting to builder - 2023-09-26T18:23:34.710Z
info: Builder connected - 2023-09-26T18:23:36.805Z
info: Installing packages - 2023-09-26T18:23:37.017Z
info: Skipping Build as no Build command set - 2023-09-26T18:23:37.162Z
info: Language - 2023-09-26T18:23:37Z
info: Pushing pid1 binary layer... - 2023-09-26T18:23:37Z
info: Created pid1 binary layer - 2023-09-26T18:23:38Z
info: Skipping Python layer creation - 2023-09-26T18:23:39Z
info: Pushing hosting layer... - 2023-09-26T18:23:39Z
info: Retrieved cached nix layer - 2023-09-26T18:23:39Z
info: Created hosting layer - 2023-09-26T18:23:40Z
info: Created Repl layer - 2023-09-26T18:23:41Z
info: Pushing Repl (cache) layer... - 2023-09-26T18:23:41Z
info: Created Repl (cache) layer - 2023-09-26T18:23:43Z
info: Pushed image manifest - 2023-09-26T18:23:43Z
info: Pushed soci index manifest - 2023-09-26T18:23:43Z
info: Creating Autoscale service - 2023-09-26T18:23:51.629Z
[2023-09-26 18:24:00] [INFO ] discord.client: logging in using static token
starting up user application
hostingpid1: an open port was not detected
error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on https://ask.replit.com/c/help/13 and a staff member will take a look. - 2023-09-26T18:25:15.303Z
My bot that will send messages from Channel A to channel B. including pictures, text, videos etc.
import discord
import os
from discord.ext import commands
intents = discord.Intents.default()
intents.messages = True
intents.message_content = True # Enable message content intent
bot = commands.Bot(command_prefix='!', intents=intents)
TOKEN = os.getenv("TOKEN")
SOURCE_CHANNEL_ID =************************** (channel ID)
TARGET_CHANNEL_ID = *************************** (Channel ID)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name} ({bot.user.id})')
@bot.event
async def on_message(message):
if message.channel.id == SOURCE_CHANNEL_ID and not message.author.bot:
target_channel = bot.get_channel(TARGET_CHANNEL_ID)
content = message.content
if message.attachments:
for attachment in message.attachments:
await attachment.save(attachment.filename)
with open(attachment.filename, "rb") as f:
file = discord.File(f)
await target_channel.send(content=content, file=file)
os.remove(attachment.filename)
elif content:
await target_channel.send(content)
try:
bot.run(TOKEN)
except discord.HTTPException as e:
if e.status == 429:
print("The Discord servers denied the connection for making too many requests.")
else:
raise e