Skip to content

Commit

Permalink
fix: add random text on msg.id, fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed Sep 24, 2022
1 parent ffde7e3 commit e8dca52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "blive-message-listener",
"version": "0.1.8",
"version": "0.1.9",
"description": "Bilibili-live danmu listener with type",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/listener/index.ts
Expand Up @@ -20,7 +20,7 @@ export type MsgHandler = Partial<

const normalizeDanmu = <T>(msgType: string, body: T): Message<T> => {
const timestamp = Date.now()
const randomText = Math.floor(Math.random() * 100).toString()
const randomText = Math.floor(Math.random() * 10000).toString()
// @ts-ignore
const id = `${timestamp}_${msgType}_${body.user?.uid}_${randomText}`
return {
Expand Down

0 comments on commit e8dca52

Please sign in to comment.