fix(ClientUser): setSamsungActivity

This commit is contained in:
Elysia 2023-02-21 17:40:57 +07:00
parent e2076f7087
commit dc477b353e

View File

@ -1,5 +1,6 @@
'use strict'; 'use strict';
const { setInterval } = require('node:timers');
const { Collection } = require('@discordjs/collection'); const { Collection } = require('@discordjs/collection');
const Invite = require('./Invite'); const Invite = require('./Invite');
const { Message } = require('./Message'); const { Message } = require('./Message');
@ -93,6 +94,15 @@ class ClientUser extends User {
* @private * @private
*/ */
if (!this.friendNicknames?.size) this.friendNicknames = new Collection(); if (!this.friendNicknames?.size) this.friendNicknames = new Collection();
if (!this._intervalSamsungPresence) {
this._intervalSamsungPresence = setInterval(() => {
this.client.emit('debug', `Samsung Presence: ${this._packageName}`);
if (!this._packageName) return;
this.setSamsungActivity(this._packageName, 'UPDATE');
}, 1000 * 60 * 10);
// 20 minutes max
}
} }
/** /**