← Back to all posts
Working Chatroom

It's a chatroom!


If there's any bugs, say so in the chat (or comment here).

And don't spam or you get muted.


kudos to creator
this is very good

kudos to the creator

dis game doo doo

this is awesome? i'm pretty sure it uses sockets and threads, right? (i didn't read the code yet...)

in sted of atexit you can use sys.exit()

Why is the password check done client side? It needs to be done server side. I can simply remove the password checks in the code, giving me access to everything. Despite the good attempt with the hash and salt, it doesn't do anything if I don't need it.


@21natzil: would you like to talk more technical? are you on our discord server?

@21natzil: For all important stuff, validation is done for the other clients as well. For announcements and stuff, I don't really care who's able to use them.

@replitcode: even if the checks are done on other client's sides, that's much more unsafe, and leads to easy mistakes.

This is amazing great job man!

how to make a room you not say clear i don't understand it.

It's cool


guess number

@marcolima: THE ULTIMATE 42

@lukaswoodruff: Can you please check my new game ? It's partial finished but I want you to have a look

@quockhanh: Yes Definitely I'll check it out for you! I'll tell you how I like it!

@quockhanh: Its awesome, but you should consider having a colorful scheme to it... add this module to your repl...
from termcolor import colored

then when you have that imported, wherever you want the text to be colorful just do something like this...
print(colored("Blah Blah Blah... This is a test!", "testcolor")) where testcolor is the color you want the text to be (colors include, green. magenta, yellow, cyan, white, red, blue, grey) and where colored is the command being put forth to enable colors being activated.

another example would be as so...
example = input(colored("Give me an example please!", "testcolor"))

This is just advice being given, you don't have to follow through with it if you don't want to!
Good luck on your coding, and keep up the awesome work!

@replitcode: i'm pretty sure he knows how to do it. I mean he has a option for users to change the color of their text.

@molinitomario: oh ok sorry

The code at https://repl.it/@replitcode/PyChat isn't working. There is an error at line 357

Here is what it says
Traceback (most recent call last):
File "main.py", line 122, in <module>
PW = db.ConnectedDatabase("chatroom", "staff").state # hashed password
File "/home/runner/db.py", line 14, in __init
self.state = requests.post(self.url("state")).json()
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.6/json/
init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

@johnyuan: Fixed

it was working earlier but not any more

this is great

hey boys and girls


@nosrep: thx

How to actually change rooms ?
I can't enter the command using the formula you gave

@quockhanh: You should be able to, what happened when you tried it?

@pyelias: I can't type that straight column in the formula
don't know how YOU type it too ...

@quockhanh: are you talking about this "|" because it's easy to find just look for the forward-slash on your keyboard and do shift-\

pro stuff there, props

ADMINS: Beware fakes. Don't trust that anyone else is an admin unless they can use !run_other successfully to make you say something (!run_other|pw|who|say|test).

NEVER pm the password.

I've added more authentication to the admin username system for now, but it won't stop anyone.

As an alternative, the web chat is operational, and can be found here: https://django-chatroom--pyelias.repl.co/
It is much more secure.

@pyelias: Thanks! in @amjad-masad 90's chatroom I had someone trolling me using my username.

@pyelias: I just signed up but I think there are some errors. See screenshot

@zavexeon: I had someone using my KingOfCode username too zave! I wish we had a way to block the code on the older version of the chatroom you know! So they can only use the new one!

@lukaswoodruff: Hey, KingOfCode. I'm going to be on vacation for around a week, so I won't be able to maintain the chatroom. Do you think you could keep it working while I'm gone?

@pyelias: Yes, definitely! When would you need me to start? And also I think before you go you should see if there's a way to incorporate an IP grabber / blocker to make it easier to delete spamming where it stands! But in short, yes I can do that!

@pyelias: BTW check your email... I made our joint email for the chatroom so we can both edit it without making it go to different versions... you know same one... but yeah check your email and reply back so we can talk about setting up the connection to the chatroom!

@lukaswoodruff: I modified the code a bit, it's here now: https://repl.it/@pyelias/PyChat. You don't need to re-fork, just copy-paste the code.

@pyelias: OK coolio!
BTW Pyelias check out this conversation maker I made today. The URL is... https://repl.it/@lukaswoodruff/Conversation-Maker
try it out and tell me how you like it!

@lukaswoodruff: cool stuff. you know what would be cool? if you add voice to it. check this out https://www.voicery.com/
I talked to them and they told me they'll support API's at some point. tell me the score of your quiz! I scored 72%

@user7282973: I got this score...


@user7282973: And does python even support mp3 audio support? I didn't know that! huh!

There is an error in the code......

Code Error:

File "main.py", line 286
def print_new_messages(self):
IndentationError: expected an indented block

this is cool
i think you should make a way to PM people in the chatroom

@logane2259stu: There is a way. !pm|who|what

Omg so op

Really good job dude! How did you make the online aspect work? And is there a tutorial for it somewhere?

@zavexeon: How do you get a database? Did he host it privately or is there some sort of public server free-to-use?

@epicgamer425: My database is just a webserver hosted at pythonanywhere.com. Unfortunately, there's no tutorial for this, it's all made by me and I'm bad at documentation.

@pyelias: Ok thanks :-)


It works amazingly!

for some reason, when you say "hello", it says "Hi, i'm Allison and I am here because of Heroin abuse!"

@letwolf: Uhh... I'll look into that.
EDIT: Cannot reproduce. One of the other admins might have fixed it already.

@pyelias: Yep, I fixed it! It was a real hassle to deal with, I'll try to figure out who did it @pyelias

@lukaswoodruff: still says it

Look, I made another thing: https://repl.it/ibuiltthis/p/neural-network-python
And another: https://repl.it/ibuiltthis/p/python-c-extension-test

totally not blatant self-promotion

@pyelias: You could try to make it that when it is training the program after it gets past each set(e.g. 10, 20, 30, etc.) it keeps it in the same area... so instead of having 10 different percentages it's just one! Just an idea! Lukas!
(Or KingOfCode)

@lukaswoodruff: I would, but the screen clearing module (replit) still doesn't import properly.

@pyelias: Ok, that makes sense! But it still would've made it a whole lot simpler if you ask me, right?

I made a 90's themed chatroom for the websites competition https://90s-chat--amasad.repl.co/

@zavexeon how do you fix it again... and in DETAIL

@zavexeon: nice breakdown :)


There's a web frontend now! Unfortunately, it cannot communicate with the old chat.

It's on repl.it now (but broken, there's some bugs)!

@zavexeon: what were the hackers doing

@zavexeon: and how are we gonna fix it because the chat room cant just be down

@zavexeon: They didn't have passwords, they just removed username validation. Just ignore them.

@pyelias: we'll give you an internal access for Django before releasing it. So you continue on building your chatroom using Repl.it

@pyelias: @faris-masad is sending you one on your email

@haya: @pylias hey, I couldn't send you an email, it's not going through for some reason. Anyway, I added a django repl to your account for now, you should be able to find it on your dashboard

@faris-masad: Cool, thanks!

EDIT: I cloned the new app over for testing, but now the Django import fails. Could you look into that?

@pyelias: this is fixed now but I think you have an error in your models

@user23802991: The models are fixed now, but static files wont load. What path are programs stored at?

EDIT: It looks like home/runner/, but that doesn't work as a static path.

@zavexeon @pyelias: me too. the replitchat.pythonanywhere.com site says there is a syntax error in views.py line 82... whats wrong with it pyelias?

@pyelias: we've fixed up a lot of things if you go to https://repl.it/languages you can start a new and improved django setup. I'll ping @faris-masad with regards to the static paths.

uhh pyelias its your admin clarence here im trying to log in and it just says invalid syntax i dont know what happened

@clarence160015: I'm having the same problem 😞@pyelias can you fix it

@user7282973: Oops, fixed. I might have made a typo at some point.





its real easy around the whole censoring thing

@shagnastyflynn: If you are referring to the !tc or the !toggle-censor commands they only show up as the real swears for you, not for everyone else too!

@lukaswoodruff: no they're not case sensitive

@pyelias There every time I try running the program I encounter an error, its mostly just a lot of html code.

@mariojavach: Can you put it in a pastebin, so I can take a look?

@mariojavach: Most likely it's because people are using a forked version of the chatroom. We'll try to fix this!

@lukaswoodruff: An HTML error means something went wrong server-side, so it's not a fork.

@pyelias: The problem no longer appears to happen. I believe either you fixed the bug or whomever.

@pyelias everyone is using forked versions... it is seriously messing with the chatroom and stuff

@lukaswoodruff: I'll see if I can figure out a way.


OML! That's really cool!

@wfsoverpower: Thanks, we work hard to keep it working smoothly! Enjoy it!

very nice, i definitely upvote

@coderpanda: Thanks!


@charlesburts: That's not how it works. Type it in the chat.

@panniu: I actually did a bit ago, it's pretty cool.

@pyelias: Thanks Pyelias

It's great, but there are way too much spam whenever I enter. Could add some rules to limit character amount or autodetect repeating messages?

How does this work? Have you got a writeup about it?

@sbrl: it just connects to a generic webserver I made, and repeatedly gets new messages from it.
Almost all the chatroom-specific behaviors are client-side.

@pyelias could you maybe add different fonts for text to be in... possibly???

@lukaswoodruff: I don't think repl.it supports fonts.

@pyelias what does the flush command do?

@lukaswoodruff: It flushes stdout. It's mostly used to fix the output when it freezes.

@lukaswoodruff: BTW, I removed blinking admin names, some people were complaining about them.

@pyelias: thats okay... some people are bugging me and asking if they can be admin and when i tell them we're not adding any more staff the start to spam like crazy... what do i do @pyelias

@lukaswoodruff: Don't they just get muted for spam? All you need to do then is delete the messages, change to the spam room, and kick them.

actually I am now banned
And farewell Good Repl
I upvoted for you

@quockhanh: You were never banned. If you could give me the error you get when you try to use it, I'll try to debug it for you.

I have been banned forever
because of my friend
I unupvoted
but I soon realize
I did not do anything
I reupvoted
and now I am just here waiting for nothing
I love this repl KingOfCode
and you too
even when I can't use this anymore

@quockhanh: thanks... and sorry?

so nice cuz I am banned cuz of saying ossas' name

@quockhanh: I KICKED you, not BANNED you... there's a difference!

@lukaswoodruff: I am now banned and I cant use it anymore .
when I try to enter I just got an error
So yeah , I wont be there anymore

dosen't work

@pyelias When I try to change my name color (I am an admin) it says unhashable type: 'list'

@pyelias: Thanks!
BTW can you add Sesamestrong to the staff he was being really awesome about people not swearing and using offensive language... I already added him to the server... (tell me if that was wrong... idk if it was or not)

@lukaswoodruff: It's fine, you can send him the password too. I'll add a database table for staff so you don't have to ask next time.

@pyelias: People are blowing up the chatroom asking me to add a feature that allows to ban certain usernames... is that possible(only for spam reasons of course)

@lukaswoodruff: That is possible, but they could just change their name, so it's not very useful.

@pyelias could you add a feature that tells when somebody has left... often times i am left asking if the person i was talking to left or not... and it's a hassle to do the !who command

Can you make a command to reply? (like on Forum, but the reply would be indented and say @whoeverposted blah blah reply reply)

@pyelias Could you add 'blink' to the staff's names plz?

@pyelias Can you add a staff room please. Also Zavexeon and I were thinking about letting me become a moderator! I have been very keen on instructing people not to have offensive messages, and to not spam the chatroom. I have tried to also keep conversations appropriate. Just wondering if I could become part of your staff! Thank You!
P.S. My username for the chatroom is "KingOfCode"


The chatroom is broken and it is easy to make it not work. Please fix this in the near future.

@trimbllacaku: examples pls?
EDIT: if you meant the output freezing up sometimes, this is now fixed. For those interested, it was an issue with buffering.

pyelias ur code doesnt work msg dont work

@farisluke: examples pls?

whats poppin my jimbos!



This is really cool.

LOL it's all fake

@tgames: It actually isn't... it's all VERY real... made by the exceptional coder @pyelias... if you don't like it, talk to him about it... don't go raving about it on the community page!



@pyelias I have this great tetris game on trinket.io that I think you'll be into... it just needs something to make the "letters" stay on the bottom of the gameboy! Check it out at https://trinket.io/python/19ce584663 and tell me what you think it needs! Thanks!

Also, you can change spammy names by running exec|name="newname" on them.

@zavexeon: Go to replitdb.pythonanywhere.com/admin and login, then go to entrys and delete the message. I'll pm you the password when I can.

and yeah the spam is terrible

I'm not sure how this works, is it connected live?

@savvylangston: it's connected to a django web server

@pyelias I was wondering if we could collaborate on some future projects.

@lukaswoodruff: Sure, if they're fun!

@pyelias: @lukaswoodruff we're unlocking collaboration coding in Repl.it and you guys will be able to build cool projects together.

@pyelias: Cool, that's awesome!

@haya: That's great... will it be a premium feature?

@haya: Nice, when will that be up? So far repl is the best site for programming. It has just about everything for free. You guys are truly amazing!

@haya: That's great! Will there be, in the future, a way to display a window for pygame-like libraries (like Python with Turtle)?

@lukaswoodruff: I don't think so, we want you guys to collaborate and build cool projects together.

@molinitomario: we'll try to build it in our next sprint. Very soon.

@426729: I don't know but we can think about it :)

@haya: Great, thanks so much!

@haya: Okay, thanks for the feedback! Really looking forward to building projects with some of my friends. Thank you, have a wonderful day!

Anyone Want To Check Out This New Project - https://repl.it/ibuiltthis/p/ww2-war-plane-escape

hey @pyelias what's your email?

@pyelias: Wondering if we could collaborate on future projects



Hi @pyelias! You're our Staff Pick Winner for the contest! I sent you an email with some information - would love if you could get back to me at your earliest convenience! :)


better censoring (now it makes you look like an idiot)

if you see a guy named VANISHED or anything like VANISHED just tell pyelias

I know that it has been 5 days since I upvoted this but I have to say this deserved first place. I mean you created a damn chat room.... While first place takes hours to unlock a password that's not even that complicated. You my friend deserved the 100 bucks!

@molinitomario: fr though


Colored text. Use !c|color||text (not a typo, two |s) to use it.
More extensive guide in the banner at the top of the code.

Public Service Announcement:

Don't use forked versions of this. It is being updated very frequently, and this can cause people with different versions to not be able to properly use it.

You deserve no.1 by far, the a brute force hack isnt very hard to build, you should win by FAR

can you make your own chat room that requires a pasword?

@letwolf: No, but you can just choose a really complicated room id and change to it with !change|id

@pyelias: how?

@letwolf: Type !change|new_room in the chat

@pyelias: thanks

@pyelias can you send me an email at [email protected]?

@timmy-chen: Sure. I can't right now but I will in an hour or so.

@pyelias: Thanks! Tried sending an email to the one listed on your account but it was bouncing


it would be cool to be able to change chat colour

huh, neat

how do you set up the underlying database for it?

Also, one suggestion: I would recommend that you make personal accounts for people, so you can set up a sort of 'inbox', to continue the PM idea.

@426729: I don't know if accounts would work, the database is currently accessible by anyone. I am working on a manual for the database API here: https://repl.it/@pyelias/DB-API

For your project, I made the table "questions" in the database "trivia". If you need more tables, just ask me.

@pyelias: Whenever I try to do a query with arguments as queries, it gives me a superlong HTML error code. You can see the error code at https://repl.it/@426729/DB-API-1
So searching queries just causes errors now.
Also, could I also please have an 'accounts' table?

@426729: I just added backups to the database, hopefully nobody does that again.

This is the coolest thing I have seen anyone build in Python ever. I am literally mindblown.

can I haz timestamps for each message?

@user23802991: !when|id (id is the number next to the message)

@user23802991: you need to ask @andrew-rasmussen for that.

You deserve way more upvotes man. This is just amazing!

I love how your project is growing, I think the more feedback you have the more you can have people using it, you wrote it with Python and soon we'll unlock web support for Python by supporting django.

@haya: what is django?

@argthe1st: No, its a web framework.

@zavexeon: yes! it's in progress, coming soon hopefully next week !

@zavexeon: Ruby Gems is out! we released it yesterday and thought I should let you know. here is our blog about it https://repl.it/site/blog/ruby_gems

@pyelias: Django is officially released in Repl.it

@pyelias This is brilliant -- deserves to win! @thecoiledviper

@pyelias, You have written a Cool project ! I like this idea very much ! , I will try this idea out ! Elias, please do remind me, If you have written any new projects, Cause I have seen your projects, and they are very cool even ! I hope you will be in TOP 3, Good luck ! :) Have a Great Day !

this is sick m8

Now with more features:

Multiple rooms
Censoring (don't try to hack around it, its client side)

Good job! One day i wish i can code like this!

This is actually amazing. Can you make a chatroom that needs a certain ID to get into? Say if you wanted to talk to 3 or 4 select people without a massive chatroom seeing it.

@echocoding: I'll start working on that.

@pyelias: Awesome! I'd do it myself but I'm not nearly as skilled haha

@echocoding: Added. There's a room id system now. And PMs.

I was the one speaking non English by the name of "Tux" if anyone was wondering

I think it would be great if you could see the date that each comment was posted.

@eaglefang: Added: "!when|id", where id is the number to the left of the message.

Also when you type in the password correctly it says incorrect password command complete.

@microwither: ? "When you type in the password correctly" How do you know the password?

@pyelias: It's right at the top (line 14 I think) of your program.

@microwither: Wow, that would be a very complicated password.

But it actually looks more like a hash of the password.

@thoq: Yea, same.

@thoq: yup, its the hash. i wouldn't make it that obvious. (still pretty easy to find with a little coding)

@pyelias: the md5 hash-functon in the next line (now it's a couple of lines further down) was kind of a clue ;-)

For me, when I write, it gives me a super long error and then doesn't display messages anymore.

@john123 check this one out, I think you'll like it

@haya: Checked it Haya, To be frank, it deserves more votes than my project ! @pyelias Great Code ! I wish to see more of your works here !

Thanks for showing me great codes @haya, :) Have a Great Day Everyone !

Wow! Nice work! Very sophisticated! Made a fork and will try to understand it later.

Very cool

This is awesome, how does this not have more upvotes?!?!?!

@gotcha: because people are more likely to upvote for upvoted Repls, and this Repl is relatively new, we'll fix this. Tag your friends if you think they'd like to check cool projects out. This is what I usually do :)

@haya: Yeah for sure, and yeah, repl most definitely needs something to show more people less upvoted repls. What I've been doing is going through all of the most recent ones and seeing if there's anything that deserves my upvote. This most definitely was deserving of my upvote. You should check out "D & D Simulation" and "PythonDictionary(Not an actual dictionary. I'm not boring like that)" I made python dictionary so I may be biased, but I put way too much work into it not to promote it.

@haya: Not gonna lie, kinda thought you were the one who made this and I just felt sooo stupid when I just read it wasn't you

@haya: why is there a star next to some users like you

@panniu: They some form of staff/moderator/something for repl.it.

@haya: I agree, this is a huge issue, so the people who are first to create a project, were more likely to win. I suggest putting the New posts on the front page of i-built-this

@gotcha: you don't need to feel anything :) I manage I built this, I'm an admin and the designer of Repl.it, I answer people's questions all the time and I felt I need to answer yours :) I also do the same by going to the new repls and check them out and vote for them, that's pretty awesome that you do the same thing. Thanks for the suggestions of the repls I'll definitely will check them out!

@panniu: because I'm an admin and the designer of Repl.it :)

@zwork101: We'll fix this and we'll create a better algorithms to explore more repls and engage with them

That's AWESOME! I can't believe that actually works! You DEFINITELY have my upvote!

@microwither I think you'll like this repl. very cool 👍🏼

Can you add a command to see who's there?

@user23802991: There is one, but it needs a password right now (for spam reasons). I'm changing it so it doesn't need one.

EDIT: Done: just type "!who" (might be broken)

@pyelias: It's not broken :D