mirror of
https://github.com/hexastack/hexabot
synced 2025-03-12 23:20:40 +00:00
feat(api): make methods public
This commit is contained in:
parent
16101f2638
commit
3c8deb854e
@ -68,7 +68,7 @@ export class BotStatsService extends BaseService<BotStats> {
|
|||||||
* @param {Subscriber} subscriber - The subscriber object that contains last visit and retention data.
|
* @param {Subscriber} subscriber - The subscriber object that contains last visit and retention data.
|
||||||
*/
|
*/
|
||||||
@OnEvent('hook:user:lastvisit')
|
@OnEvent('hook:user:lastvisit')
|
||||||
private handleLastVisit(subscriber: Subscriber) {
|
handleLastVisit(subscriber: Subscriber) {
|
||||||
const now = +new Date();
|
const now = +new Date();
|
||||||
if (subscriber.lastvisit) {
|
if (subscriber.lastvisit) {
|
||||||
// A loyal subscriber is a subscriber that comes back after some inactivity
|
// A loyal subscriber is a subscriber that comes back after some inactivity
|
||||||
@ -110,7 +110,7 @@ export class BotStatsService extends BaseService<BotStats> {
|
|||||||
* @param name - The name or identifier of the statistics entry (e.g., a specific feature or component being tracked).
|
* @param name - The name or identifier of the statistics entry (e.g., a specific feature or component being tracked).
|
||||||
*/
|
*/
|
||||||
@OnEvent('hook:stats:entry')
|
@OnEvent('hook:stats:entry')
|
||||||
private async handleStatEntry(type: BotStatsType, name: string) {
|
async handleStatEntry(type: BotStatsType, name: string) {
|
||||||
const day = new Date();
|
const day = new Date();
|
||||||
day.setMilliseconds(0);
|
day.setMilliseconds(0);
|
||||||
day.setSeconds(0);
|
day.setSeconds(0);
|
||||||
|
@ -235,7 +235,7 @@ export class SubscriberService extends BaseService<
|
|||||||
* @param subscriber The subscriber whose is being handled.
|
* @param subscriber The subscriber whose is being handled.
|
||||||
*/
|
*/
|
||||||
@OnEvent('hook:user:lastvisit')
|
@OnEvent('hook:user:lastvisit')
|
||||||
private async handleLastVisit(subscriber: Subscriber) {
|
async handleLastVisit(subscriber: Subscriber) {
|
||||||
if (subscriber.lastvisit) {
|
if (subscriber.lastvisit) {
|
||||||
try {
|
try {
|
||||||
const user = await this.updateOne(subscriber.id, {
|
const user = await this.updateOne(subscriber.id, {
|
||||||
|
Loading…
Reference in New Issue
Block a user