parent
e79059820f
commit
0619522bb1
@ -0,0 +1,26 @@
|
|||||||
|
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
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in new issue