mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-20 11:11:38 +01:00
add inventory, give and admingive commands. Handle user records in database and minor bugfixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { AccessToken } from "@twurple/auth";
|
||||
import PocketBase, { RecordService } from "pocketbase";
|
||||
import type { inventory } from "../items";
|
||||
|
||||
const pocketbaseurl = process.env.POCKETBASE_URL ?? "localhost:8090";
|
||||
if (pocketbaseurl === "") { console.error("Please provide a POCKETBASE_URL in .env."); process.exit(1); };
|
||||
@@ -13,15 +14,15 @@ export type userRecord = {
|
||||
id: string;
|
||||
username: string;
|
||||
balance: number;
|
||||
inventory: object;
|
||||
inventory: inventory;
|
||||
lastlootbox: string;
|
||||
};
|
||||
|
||||
type TypedPocketBase = {
|
||||
interface TypedPocketBase extends PocketBase {
|
||||
collection(idOrName: 'auth'): RecordService<authRecord>;
|
||||
collection(idOrName: 'users'): RecordService<userRecord>;
|
||||
};
|
||||
|
||||
const pb = new PocketBase(pocketbaseurl) as TypedPocketBase;
|
||||
export default pb.autoCancellation(false);
|
||||
|
||||
export default pb;
|
||||
|
||||
Reference in New Issue
Block a user