mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
feat: 追踪退出
This commit is contained in:
@@ -2,17 +2,25 @@ import https from 'node:https';
|
||||
import { napCatVersion } from './version';
|
||||
|
||||
export class umamiTrace {
|
||||
static napcatVersion = napCatVersion;
|
||||
static qqversion = '1.0.0';
|
||||
|
||||
static init(qqversion: string) {
|
||||
this.qqversion = qqversion;
|
||||
setInterval(() => {
|
||||
this.trackEvent('heartbeat');
|
||||
}, 5 * 60 * 1000);
|
||||
}
|
||||
|
||||
static trackEvent(eventName: string, info?: string) {
|
||||
const StatesData = {
|
||||
type: 'event',
|
||||
payload: {
|
||||
'website': '596cbbb2-1740-4373-a807-cf3d0637bfa7',
|
||||
'hostname': 'trace.napneko.icu',
|
||||
'language': process.env.LANG || 'en-US',
|
||||
'title': 'NapCat ' + napCatVersion,
|
||||
'url': '/' + napCatVersion + '/' + eventName,
|
||||
'referrer': 'https://trace.napneko.icu/' + napCatVersion,
|
||||
'info': info
|
||||
'title': 'NapCat ' + umamiTrace.napcatVersion,
|
||||
'url': '/' + umamiTrace.qqversion + '/' + umamiTrace.napcatVersion + '/' + eventName,
|
||||
'referrer': 'https://napcat.onebot.napneko.icu/' + umamiTrace.qqversion + '/' + umamiTrace.napcatVersion + '/' + info,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user