U want to chat with people? Well Bigchat is for you.
Bigchat is a not so big chat that you can chat on. Its simple, go to the project. Type your username and start chatting.
The chat has admin commands, only accessible by Admins.
Yes… Well technically you shouldn’t send the /command to the server, you should rather detect user input and see what the user is trying to do an make that an API (either through http requests or through socket.io connection).
I could help you more later, although I gotta go make myself some dinner, haven’t eaten today
there’s a number of ways to do it, but essentially you want to first detect that a command is being given (like how chat clients know that if the message starts with “/” and no space after, whatever comes after it is the command). i often do this detection on the client side so that if there is an error, the i can tell the user before the server tries to do any work.
i am having a hard time finding commands i’ve built (E_TOO_MANY_REPOS lol), but here is an example of using regex to filter message content URLs and keywords to trigger emoji on the client side (see this code i wrote over 6 years ago lol https://github.com/jennschiffer/skatroom/blob/master/public/js/skatroom.js#L174). you can laugh at the project name, it was an art project where we turned a gallery’s restrooms into a chatroom lol.
Interesting. It looks like you kept the admin keys in an env or somewhere. Cause I tried to break into it, (Basiclly testing security)
and I found this.
let socket;
let adminCode = "";
let username = "";
let closeReason;
So I am guessing this is TBD (To Be Done) or just pre-data. Because I see usernamesocket, adminCode, and closeReason. So I am guessing that the admin code is somewhere in an ENV or JSON file and it is changed. I never looked through the whole script, but I think if I looked hard enough I could crack it. (Again, I am checking security.)