add notify module

master
John Montagu, the 4th Earl of Sandvich 2024-05-16 09:17:12 -07:00
parent d3d66ded45
commit 0ea2058a7c
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import { Module } from "../module";
import { Feature, WhosOnlineResponse } from "./types";
export class NotifyModule extends Module {
public async fetchOnlineUsers(feature: Feature) {
return this.client._call(
WhosOnlineResponse,
"notify.whosonline",
{
feature: feature as string,
}
);
}
}

View File

@ -0,0 +1,14 @@
import { TCResponse, TCResponseRaw } from "../types";
export class WhosOnlineResponse extends TCResponse {
users: { id: string };
public constructor(res: TCResponseRaw) {
super(res);
this.users = res["users"];
}
}
export enum Feature {
FORUM = "forum",
}