repl chat: Integrated global chat for repl.it
h
MrEconomical (1956)

repl chat yey

After making repl mail, I still wasn't satisfied. There was a mailing system now, but no way to chat in real time on repl.it itself. So I decided to make a chat system cool kek.

Features

(yes I love this repl share post format dont judge)

  • Log in with repl auth - use repl auth to log in with your repl account @amasad
  • Integrated - repl chat pops up right on repl.it! I styled it based on the multiplayer chat so it is a little window on the bottom right. I just tweaked a few things to improve the UI where I saw fit. More on this in Usage Instructions
  • Fast - repl chat uses WebSocket to send chat messages in real-time
  • Message history - unlike many other chat applications cough cough and somewhat repl multiplayer chat itself cough cough repl chat stores the last 50 messages so you will have context every time you log on

Usage Instructions

To use repl chat in repl.it, save it as a bookmarklet. A bookmarklet is basically a bookmark that on click executes some javascript code, in this case adding the repl chat window to repl.it.

  1. Create a new bookmark (name it whatever you want)
  2. In the url section, copy and paste this:
javascript:!function(){if(location.href.startsWith("https://repl.it")){const t=document.createElement("script");t.id="repl_chat_script",t.src="https://repl-chat.mreconomical.repl.co/use/bookmark.min.js",document.body.appendChild(t)}else alert("Go to https://repl.it to use repl chat!")}();
  1. Now, when you are on repl.it, if you want to add the repl chat window, simply click on the bookmark!

If you really wanted to, you could use the browser client here: https://repl-chat.mreconomical.repl.co but why tho?

DATABASE SOURCE CODE: https://repl.it/@MrEconomical/repl-chat-database-source

You are viewing a single comment. View All
P3tray (3)

You should probably put out a guide on how to make your own database, i will try to figure it out myself for now. Also, i have tried to modify the simple JavaScript function to allow it to work elsewhere, however it does not seem to work. Is that possible (I am probably doing it wrong, because i rarely use JS)?

This thing is amazing.

MrEconomical (1956)

@P3tray it might be possible on some sites, but many sites block script requests to other sites (for instance, google sites) so it wont work on any of those

P3tray (3)

Nevermind. I probably will not be able figure it out because i cannot access any blank sourcecode for the database. I am too lasy unskilled to make my own completely from scratch trying to figure out what the sourcecode would be.
@MrEconomical You should make https://repl-chat-database-source.mreconomical.repl.co containing the source without any logs or data, because that would really help. Great work.

P3tray (3)

@MrEconomical Thanks, working on making a button that will work universally too (still using repl.it auth), i can give you the code as well if i get it done.

It will probably be done tomorrow, as i have no time now.

And yeah, most sites will not like it.

P3tray (3)

Got that chat working for me. Took a while to figure out which errors where coming from where, and which parts i broke trying to fix other parts.

The main problem was figuring out the key, i set it through the console of the repl-chat (process.env.REPL_CHAT_KEY = "your key here".

I also put a comma where i shouldn't... That confused it and didn't give an error, the messages would not load.

P3tray (3)

Personal database working on other sites.

Repl.it chat on DuckDuckGo: