Share your repls and programming experiences

← Back to all posts
All Chat! -A Python Chat (Now Version 3.5)
h
JWZ6 (647)

WELCOME!

This is a chat in Python!

We have ran out of slots for mods. Sorry

If There's An Error

We are undergoing some changes.

Credits:

Inspiration - @JBloves27

Devs

Updates:

Version 2

  • New Markdown
  • Instructions
  • ASCII

Version 3

  • Blocks Swearing
  • Moderator Confirmation
  • See Old Chats

Version 3.5

  • Feedback!
  • New colors

If you like this, you may like our Text 2 ASCII program!

Mods

Rules

  • Dont cuss, say slurs, harass people, and advertise.

  • No NSFW. This is not for NSFW.

  • No impersonating Moderators/Developers/Owners.

  • Don't say any personal info.

We care for the safety of our users."

And if you need Moderators Feel free to call for some.

All Chat Inc. Copyright Reserved.

Command

All Chat

'bold', 'italic', and 'underline' for markdown!

'ASCII' for ASCII art!

'exit' and 'quit' to leave

'change_name' to change your username

'old_messages' to see old messages

'feedback' to rate the chat

Dear Users, remember to NOT swear, keep it friendly!

Ping us if you need our help with something

Everyone, go to here for the chat to work!

Comments
hotnewtop
OldWizard209 (1499)

@JWZ6, @SamiOsman, @LOLguy1123455. I am not a hater or anything, but you should recognize that this program has a MASSIVE flaw in it. In fact it is not secure at all.

Firstly, you are saving all the chat into a text file. That is the worst choice of saving data you could probably think of. Anyone can wipe all the data clean in a second.

Secondly, one you open the chat using with, you don't need to close it:

The chat also doesn't update, you have to hard reload to see the new chat because it is getting saved in the text file, and most if the time it doesn't. I triedd from a different laptop, nothing changed. An actual chat works live and constant updating chat. You writing into the text file destroys the point completely. This (no offense) is almost low effort.

I express no hate or offense, I am just saying how this can be much better and how the description is biased.

JWZ6 (647)

@OldWizard209 hmm it updates for me and only me and moderators can delete the text

OldWizard209 (1499)

that doesn't change the fact that it is unsafe and not a way to make a chat. Also the mods are manually deleting text from the file....... @JWZ6

JWZ6 (647)

@OldWizard209 well we clear it in case it gets a bit too long

FlaminHotValdez (683)

@JWZ6 that's the point, you can use the console to completely delete the chat

FlaminHotValdez (683)

@JWZ6 Yet another flaw in the system-what if somebody wants to see earlier chat messages? You can't because the entire file has been deleteed

IMayBeMe (456)

@OldWizard209 I 100% agree with you, this is way over advertized

JWZ6 (647)

@IMayBeMe hmm im trying to find a safe way to store python input safely

IMayBeMe (456)

@JWZ6 A safe way is to use an env var with a database or just use sockets.

JWZ6 (647)

@IMayBeMe how do i do dat in Python

IMayBeMe (456)

@JWZ6 Read the repl db docs

JWZ6 (647)

@OldWizard209 @IMayBeMe me and @ch1ck3n are amking a django chat website

maxina (59)

@JWZ6 Maybe try learning databases?

IMayBeMe (456)

This feels like a somewhat cheap way to create a python chatroom. The fact that your re-writing a text file and printing it defeats the whole purpose, considering that a chat is a way to connect multiple clients to a server and have them message each other.

Internet Relay Chat (IRC) is an application layer protocol that facilitates communication in the form of text. The chat process works on a client/server networking model. IRC clients are computer programs that users can install on their system or web based applications running either locally in the browser or on a third party server.

Also, judging based on the code, the moderators are completely fake and have no powers/abilities within the chatroom.

JWZ6 (647)

@IMayBeMe i mean mods are if anyone cusses or something mods delete their text. txt file takes the input in and shows it out to others. ig that works but i see your point

LOLguy1123455 (24)

@JWZ6 , that's right. We can delete it in the code but I kind of looks like you have to reload to see the effect

IMayBeMe (456)

@JWZ6 But that's manual deletion through the editor which goes against how mods on a chat are supposed to work. Also, another issue with the chat is security because I can completely overwrite every message on the chat using 3 lines of code on the console.

IMayBeMe (456)

@JWZ6 re-write the file through the console just like how you re-write the file in your actual code

JWZ6 (647)

@IMayBeMe hmmmmmmm im a bit confused

Dunce (65)

@IMayBeMe What do you mean? Any code that gets typed in the console is never executed, because it goes through the input function, right?

FlaminHotValdez (683)

@Dunce no, they control-c and use console commands. They're no longer in the chatroom and they can modify files using the console.

FlaminHotValdez (683)

@JWZ6 so you blatantly ignore the fact that your chatroom can literally be deleted any second?

Dunce (65)

@FlaminHotValdez I just tried it, and ctrl + c raises the error:

Type in your message: Traceback (most recent call last):
  File "main.py", line 23, in <module>
    message = input("\033[0mType in your message: ")
KeyboardInterrupt
JWZ6 (647)

@FlaminHotValdez we got a bakup one but i see ur point

FlaminHotValdez (683)

@Dunce That's the point, now you are in the console and you can enter commands.

FlaminHotValdez (683)

@JWZ6 and explain why they can't completely wipe the backup one?

JWZ6 (647)

@FlaminHotValdez hmm well i think i can trust them to not wipe the bakup one

Dunce (65)

@FlaminHotValdez Oh, I see what your saying. That seems like something Replit needs to fix.

IMayBeMe (456)

@Dunce It's not replit's fault, it's whoever wrote this program's fault. The console works the way it was intended to, and the lack of security in the code is what makes it vunerable.

FlaminHotValdez (683)

@JWZ6 and what if someone hacks it?

Dunce (65)

@IMayBeMe Yeah, but unless I'm missing something (which I probably am, because I'm an absolute idiot), doesn't that mean that you can go into any repl's console, press ctrl + c, and mess with it however you want? If so that seems like a serious issue Replit needs to resolve.

FlaminHotValdez (683)

@Dunce it's an intended feature so that you can fiddle with the console and stuff

IMayBeMe (456)

@Dunce You can't mess with the actual code, you can only mess with things like a database or files

Dunce (65)

@IMayBeMe Yeah, I always thought when you ran a repl, any changes to the files, or database would only show up for you. But than if that's true, how do the new chats show up?

SamiOsman (41)

@FlaminHotValdez @IMayBeMe Could you maybe give me an example code on how to do that? (delete the code)

IMayBeMe (456)

@SamiOsman it doesn’t delete the code but rather clears the text file completely including the instructions. Here is the code:

with open(“chat.txt”, “w”) as x:
  x.write(“every thing is deleted”)

btw if the code looks weird, that’s just cause I’m on mobile

SamiOsman (41)

@IMayBeMe Really. Huh. So when you come back the text file is cleared? It saves your progress even when you come back? I thought the console didn't work that way. Also, we are working on a safer way to do this.

JWZ6 (647)

@IMayBeMe err it isn't fully deleted

IMayBeMe (456)

@JWZ6 it actually is apart from whatever I wrote on that second line, try running it in the console, all the file should have is “every thing is deleted”

JWZ6 (647)

@IMayBeMe well i just hope u enjoy some parts at the very least

IMayBeMe (456)

@JWZ6 I’m not gonna even argue with someone who is clearly too incompetent to understand beginner python or what a console is. Go google file handling in python and you will understand

SamiOsman (41)

@IMayBeMe I don't think I am incompetent. (Sorry @JWZ6) I managed to disable ctrl-c and make it so whenever you do it, this happens: os.system('clear'). I also made sure that the program never exits. I found alternative ways to that. If there is any other way to wipe out the text file please let me know

[email protected]

SamiOsman (41)

@JWZ6 Yw ;)! I really just want **@IMayBeMe to respond. I want to see if there is any way to improve. I am open to suggestions.

FlaminHotValdez (683)

@SamiOsman Good job! Now I have to click the stop button to enter commands in the console. That made my job of wiping the chat harder by 0.1%!

SamiOsman (41)

@FlaminHotValdez Huh oooh... didnt think of that...Hmmm could I invite you to the repl to help us fix it?

FlaminHotValdez (683)

@SamiOsman I don't think you can do anything to disable the stop repl button seeing as it's one of the mechanics in replit

FlaminHotValdez (683)

@JWZ6 Is that your default response when you can't figure out anything to defend yourself?

IMayBeMe (456)

@SamiOsman my original strat of overwriting the file through the console still works

JWZ6 (647)

@IMayBeMe eeeeeeeeeeeeeeeeeeeeeeeeeeee

SamiOsman (41)

@IMayBeMe Oh I see, I was debugging it and I messed it up. Anyways, could you maybe come and help us?

IMayBeMe (456)

@SamiOsman I think the easiest way to fix it would be to save every message to a data base string and use beeline characters to split it something like this:

from replit import db
db[‘some_key’] = ‘test message\n’
db[‘some_key’] += ‘next message\n’
print(db[‘some_key’])

you can replace some_key with your own which can then be stored in the env section. Also this is just a rough overview so you can add your own input and adding stuff to the db

JWZ6 (647)

@IMayBeMe wow u are a GENIUS thank u so much

JWZ6 (647)

@IMayBeMe i shall apply that tommorow (cuz i gotta go sleep now)

ch1ck3n (2035)

after careful consideration i've decided to award you the POG AWARD!

confirmed by ch1ck3n, the founder of the pog awards comitee

JWZ6 (647)

@ch1ck3n do u want to be mod?

JWZ6 (647)

@ch1ck3n also btw u got da wrong link for python chat lol

JWZ6 (647)

@ch1ck3n btw y are there barely any pog award repls? lol

ch1ck3n (2035)

@JWZ6 pog awards are for the poggiest repls

JWZ6 (647)

Only three poggiest repls two are mine lol @ch1ck3n

SamiOsman (41)

@JWZ6 Give credit man! 2/3 of them are yours! Not 2 wholes! You OWN the repls but both of them wouldn't be half-good without the team!

ch1ck3n (2035)

@SamiOsman That, replit culture, is called unluckyfroggying

SamiOsman (41)

@ch1ck3n huh...Oh you mean unluckyfroggying... I didn't mean too but it is right. (Not tryna sound jealous btw). xD

ch1ck3n (2035)

@FlaminHotValdez its hard to forget when you've been unluckyfroggied by none other than unluckyfroggy humself

ch1ck3n (2035)

@FlaminHotValdez oh my this game im playing has an achievement for cheating

FlaminHotValdez (683)

@ch1ck3n fr? didn't he list you in credits?

chicken != potato

FlaminHotValdez (683)

@ch1ck3n oh my gods fr? which game is that I have to see

ch1ck3n (2035)

@FlaminHotValdez jk its the game im making

https://clicker.ch1ck3n.repl.co/

im working on achivements

IGamer123 (76)

btw this is rly cool and its amazing that ya made it in python @JWZ6

JWZ6 (647)

@IGamer123 thx if you like plz updoot (only if u is like lol)

dObbOb11 (13)

You don't even need to do ctrl+c you can just go into the shell yab and type rm chat.txt

dObbOb11 (13)

@JWZ6 if you type that then the entire chat.txt file is deleted.

SilvermoonCat (436)

one ting: I can choose I am a moderator, choose a username and log in as a moderator. You should have at least a secret passwrd using replit’s secret code feature thing. or something more secure.

JWZ6 (647)

@SilvermoonCat yes ik but it detects if u isn't mod right?

SilvermoonCat (436)

@JWZ6 now it works, yesterday I signed in as a mod but now I can’t

SilvermoonCat (436)

@SilvermoonCat BTW: it says “hi hi Im brandon, type chat_bot” however, in order for it to work you have to type bot_chat.

kwe (54)

really cool for a simple chat

PyCoder01 (53)

PLEASE PUT THE BAD WORDS IN A DIFFERENT FILE

PyCoder01 (53)

@JWZ6 rewrite the bad_words list in badwords.py and do from badwords import bad_words

PyCoder01 (53)

@JWZ6 learn python pls. XD

JBloves27 (1878)

Hiya there,

It seems like you used some code from my template, which is cool, but I have some things to mention.
This does not actually save, as the .txt file does not work as db (I'll put that on the template). To actually save, you might want to import db things, etc.
Also, you might want to print the chat text in the console, or make this a flask app with db.

Thanks!

JWZ6 (647)

Me and ch1ck3n are working on a python django chat web so this’ll be better @JBloves27

JWZ6 (647)

Could u help maybe? @JBloves27

JBloves27 (1878)

im not really good with django, but sure @JWZ6

JWZ6 (647)

Yay I’ll invite u @JBloves27

JWZ6 (647)

Ah max people sadness @JBloves27

KadenBlox (5)

mod pls, would upvote if there was a button

JWZ6 (647)

@KadenBlox there is at the very top

JWZ6 (647)

@Awesomecoder345 np just don't go too crazy

Awesomecoder345 (3)

how would we delete someone message if they break [email protected]

JWZ6 (647)

@Awesomecoder345 go to chat.txt (file) and search for a bad word. Then, delete the comment that has the bad word.

LOLguy1123455 (24)

only 3 more slots for moderators or coders!

LOLguy1123455 (24)

new update! Ascii text.
If you type something in then this will appear Traceback (most recent call last):
File "main.py", line 60, in <module>
chat_txt.write(tprint(ascii))
TypeError: write() argument must be str, not None
please opy and paste and enter the chat until we fix that bug.

xXToluwaXx (72)

Repl.it: Package operation failed. oh nuu this is the end of the world

JWZ6 (647)

@xXToluwaXx we were debugging lol

xXToluwaXx (72)

@JWZ6 i opened it to the spotlight page and it works there

JWZ6 (647)

@ch1ck3n thx just added change username feature

ch1ck3n (2035)

@JWZ6 might give pog award but pls make it more pog

JWZ6 (647)

@ch1ck3n hmm u can be a mod?

JWZ6 (647)

@ch1ck3n new underline, bold, italic

xXToluwaXx (72)

@JWZ6 pog you put a elif on line 52

JWZ6 (647)

@xXToluwaXx oh yeah were almost done with that part. btw if u like dis pls upvote (only if you like)