mirror of
https://git.wownero.com/wowlet/wowlet-backend.git
synced 2024-08-15 01:03:13 +00:00
26 lines
473 B
Python
26 lines
473 B
Python
import re, sys, os
|
|
from datetime import datetime
|
|
import time
|
|
|
|
from wowlet_backend.factory import broadcast
|
|
|
|
HISTORY = []
|
|
|
|
|
|
async def add_chat(message: str, balance: float = 0):
|
|
global HISTORY
|
|
item = {
|
|
"message": message,
|
|
"balance": balance,
|
|
"date": int(time.time())
|
|
}
|
|
|
|
HISTORY.append(item)
|
|
if len(HISTORY) >= 25:
|
|
HISTORY = HISTORY[:25]
|
|
|
|
await broadcast.put({
|
|
"cmd": "trollEntry",
|
|
"data": item
|
|
})
|
|
|