Skip to content
Move Console Messages to the Express Server
Profile icon
NotDotu

In the provided Repl, the code connects to a Discord Bot to log every message in a designated Discord channel, and allows users to talk from the bot into the Discord server.

What I would like to do, however, is have the messages relay to the Express server (./server.js), and allow the user to type there, rather than in the console. Is this possible? And, if so, how would I go about doing this? I am relatively new to node.js, so any advice is welcome.

You are viewing a single comment. View All
Profile icon
RohilPatel

Hey there! Yeah, you could use socket.io and make a listener for when user clicks enter and then use a specific channel to write everything in

Profile icon
NotDotu

@RohilPatel
When running the repl (without errors, but I have intentionally added one), the file "server.js" creates its own webpage of sorts. That's where I wish to store everything (and have the user input).

Profile icon
RohilPatel
Profile icon
RohilPatel
Profile icon
NotDotu
Profile icon
RohilPatel

could u explain this better?

@NotDotu

Profile icon
NotDotu

@RohilPatel
I'm trying to have the person use the console not have to open discord at all

Profile icon
RohilPatel

then use a readline thing and make it push to the discord client
just have the function write to a channel


@NotDotu