Implement most of status system (still kinda bootycheeks at checking if
you're connected), fionally fix prettierrc
This commit is contained in:
parent
126acf52f3
commit
e64910d895
29 changed files with 2001 additions and 879 deletions
|
|
@ -1,17 +1,14 @@
|
|||
import { json } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
import { Status } from '$lib';
|
||||
|
||||
import { kvStore } from '$lib/server/db';
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
const { userId } = params;
|
||||
const { userId } = params;
|
||||
|
||||
const status = Object.values(Status)[Math.floor(Math.random() * Object.values(Status).length)];
|
||||
|
||||
return json({
|
||||
userId,
|
||||
status,
|
||||
lastActive: Date.now() - Math.floor(Math.random() * 600000),
|
||||
customStatus: Math.random() > 0.5 ? 'vibing 🟢' : null,
|
||||
});
|
||||
return json({
|
||||
userId,
|
||||
status: kvStore.get('user-' + userId + '-state'),
|
||||
//@TODO Implement statusmessage
|
||||
statusMessage: Math.random() > 0.5 ? 'vibing 🟢' : null
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue