I have my WebSockets working with django channels. The last thing I'd like to do is close the socket if a user clicks a button, so in the frontend, I just send a disconnect message to the server:

`socket.send({action: 'disconnect'`});

Then, in my consumer, I simply disconnect:

```
async def receive(self, text_data):
    text_data_json = json.loads(text_data)
    if 'action' in text_data_json and text_data_json['action'] == 'disconnect':
        await self.disconnect(0)

async def disconnect(self, close_code):
    await self.channel_layer.group_discard(
        self.room_group_name,
        self.channel_name
    )

```

Why is my WebSocket not disconnecting properly? (I still receive messages)