add notify module
							parent
							
								
									d3d66ded45
								
							
						
					
					
						commit
						0ea2058a7c
					
				|  | @ -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, | ||||
|             } | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|  | @ -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", | ||||
| } | ||||
		Loading…
	
		Reference in New Issue