15 lines
452 B
TypeScript
15 lines
452 B
TypeScript
import { TCPHandler, Context } from '../class';
|
|
import { dataConversion } from '../functions';
|
|
|
|
export default class Storage extends TCPHandler {
|
|
constructor() {
|
|
super();
|
|
this.endpoint = 'storage';
|
|
}
|
|
|
|
public async handle(ctx: Context) {
|
|
const res = await ctx.client.redis.get(`storage-${ctx.data.username}`) ? dataConversion(Number(await ctx.client.redis.get(`storage-${ctx.data.username}`))) : 'N/A';
|
|
return ctx.send(res);
|
|
}
|
|
}
|