Skip to content
← Back to Community
How does pinging work?
Profile icon
CyberPy

This question randomly came to me, but how does the pinging system work in replit? (Not that I'm trying to steal your idea, I don't do JS)

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
CyberPy
Comments
hotnewtop
Profile icon
VulcanWM

idk how replit does it but in my social media website, i check each word to see if it starts with @, then I remove the @ from the word. If the word is a real user's username, I give them a notification

Profile icon
CyberPy

@VulcanWM I know how that works, but how does the ping actually go to the pinged persons notifications?

Profile icon
Coder100

its in the db @CodingEssence

Profile icon
CyberPy

@Coder100 db as in database, right?

Profile icon
VulcanWM

Yeah as the the notifications are saved in a database replit can control @CodingEssence

Profile icon
Coder100
Profile icon
CyberPy

@Coder100 @VulcanWM ooo ok got it thanks!

Profile icon
Coder100
Profile icon
VulcanWM
Profile icon
IMayBeMe

Pinging works almost identically to messaging. Each user should have a database key and when the code detects an @ it takes the target username and puts a notification under that database key.

Profile icon
CyberPy

@IMayBeMe ok thanks!