jarvis-server-v2/jarvis/utils/chat_utils.py

14 lines
480 B
Python

import logging
from jarvis.api import socketio
def send_user_message_to_room(text, room_id):
logging.debug("Sending message from user to room " + room_id + " : " + text)
socketio.emit('message_from_user', {'data': text, "uuid": room_id}, to=room_id)
def send_jarvis_message_to_room(text, room_id):
logging.debug("Sending message from jarvis to room " + room_id + " : " + text)
socketio.emit('message_from_jarvis', {'data': text, "uuid": room_id}, to=room_id)