ft_transcendence/frontend/consumers.py
2023-11-23 17:40:10 +01:00

11 lines
260 B
Python

import json
from channels.generic.websocket import WebsocketConsumer
class ChatConsumer(WebsocketConsumer):
def connect(self):
self.accept()
self.send(text_data=json.dumps({
'type':'connection_established',
'message':'You are now connected!'
}))