INNER CODE UNIT · Python

send_private_typing_notification

zapek/Xeres · scripts/bot/bot.py:264

def send_private_typing_notification(conn, destination_id):
	conn.send(destination="/app/chat/private",
	          content_type="application/json",
	          headers={"messageType": "CHAT_TYPING_NOTIFICATION",
	                   "destinationId": f"{destination_id}"},
	          body=json.dumps({"content": ""})
	          )


def strip_nickname_prefix(message, nickname):
	if message.startswith(nickname + ": "):
		return message[(len(nickname) + 2):]
	return message


def evict_cache(messages):
	if (len(messages)) > INTERACTIONS * 2:
		messages.pop(0)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…