ChatConsumers

class chat.consumers.ChatConsumer(*args, **kwargs)[source]

Bases: WebsocketConsumer

Websocket consumer for chat.

connect()[source]

Accept the connection.

disconnect(code)[source]

Disconnect the user.

receive(text_data=None, *args, **kwargs)[source]

Receive the message from the user and send the response back.

Parameters:

text_data – The message from the user, defaults to None

class chat.consumers.CorrectorConsumer(*args, **kwargs)[source]

Bases: WebsocketConsumer

Websocket consumer for correcting sentences.

connect()[source]

Accept the connection.

disconnect(code)[source]

Disconnect the user.

receive(text_data=None, *args, **kwargs)[source]

Receive the message from the user and send the corrected message.

Parameters:

text_data – The message from the user, defaults to None

class chat.consumers.EnRuTranslateConsumer(*args, **kwargs)[source]

Bases: WebsocketConsumer

Websocket consumer for translating English to Russian.

connect()[source]

Accept the connection.

disconnect(code)[source]

Disconnect the user.

receive(text_data=None, *args, **kwargs)[source]

Receive the message from the user and send the translated message back.

Parameters:

text_data – The message from the user, defaults to None

Returns:

None

class chat.consumers.RuEnTranslateConsumer(*args, **kwargs)[source]

Bases: WebsocketConsumer

Websocket consumer for translating Russian to English.

connect()[source]

Accept the connection.

disconnect(code)[source]

Disconnect the user.

receive(text_data=None, *args, **kwargs)[source]

Receive the message from the user and send the translated message back.

Parameters:

text_data – The message from the user, defaults to None

Returns:

None