2023-11-10 22:41:42 +01:00
|
|
|
import knex from 'knex';
|
2023-11-11 01:54:11 +01:00
|
|
|
import * as log from './log';
|
2023-11-10 22:41:42 +01:00
|
|
|
|
|
|
|
export const db = knex({
|
|
|
|
client: 'sqlite3',
|
|
|
|
connection: {
|
|
|
|
filename: './jillo.sqlite'
|
|
|
|
},
|
2023-11-11 01:54:11 +01:00
|
|
|
useNullAsDefault: true,
|
|
|
|
log: {
|
|
|
|
warn: log.warn,
|
|
|
|
error: log.error,
|
|
|
|
deprecate: log.warn,
|
|
|
|
debug: log.info
|
|
|
|
}
|
2023-11-10 22:41:42 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export interface ScheduledSubscription {
|
|
|
|
name: string;
|
|
|
|
next: number;
|
|
|
|
}
|
|
|
|
export interface Subscription {
|
|
|
|
key: string,
|
|
|
|
channel: string,
|
|
|
|
guild?: string
|
|
|
|
}
|
2023-11-11 00:01:38 +01:00
|
|
|
export interface Counter {
|
2023-11-13 17:29:49 +01:00
|
|
|
id: number,
|
2023-11-11 00:01:38 +01:00
|
|
|
key: string,
|
|
|
|
emoji: string,
|
|
|
|
value: number,
|
|
|
|
channel: string,
|
|
|
|
guild: string,
|
|
|
|
message?: string,
|
2023-11-12 19:45:23 +01:00
|
|
|
allowlistConsumer: boolean,
|
2023-11-15 11:03:01 +01:00
|
|
|
allowlistProducer: boolean,
|
|
|
|
linkedItem?: number
|
2023-11-11 00:01:38 +01:00
|
|
|
}
|
2023-11-12 19:45:23 +01:00
|
|
|
export interface CounterUserLink {
|
2023-11-13 17:29:49 +01:00
|
|
|
id: number,
|
2023-11-12 19:45:23 +01:00
|
|
|
user: string,
|
|
|
|
producer: boolean
|
2023-11-13 16:10:33 +01:00
|
|
|
}
|
|
|
|
export interface CounterConfiguration {
|
2023-11-13 17:29:49 +01:00
|
|
|
id: number,
|
2023-11-13 16:10:33 +01:00
|
|
|
configName: string,
|
|
|
|
value: string
|
2023-11-15 01:40:57 +01:00
|
|
|
}
|
|
|
|
export interface CustomItem {
|
|
|
|
id: number,
|
|
|
|
guild: string,
|
|
|
|
name: string,
|
|
|
|
description?: string,
|
|
|
|
emoji: string,
|
|
|
|
type: 'plain' | 'weapon' | 'consumable',
|
|
|
|
// also damage for weapons; weapons are always unstackable (cus i said so)
|
|
|
|
maxStack: number,
|
|
|
|
behavior?: string,
|
|
|
|
untradable: boolean,
|
|
|
|
behaviorValue?: number
|
|
|
|
}
|
|
|
|
export interface ItemInventory {
|
|
|
|
user: string,
|
|
|
|
item: number,
|
|
|
|
quantity: number
|
2023-11-15 16:04:36 +01:00
|
|
|
}
|
|
|
|
export interface CraftingStationCooldown {
|
|
|
|
station: string,
|
|
|
|
user: string,
|
|
|
|
usedAt: number
|
2023-11-18 12:59:29 +01:00
|
|
|
}
|
|
|
|
export interface CustomCraftingRecipe {
|
|
|
|
id: number,
|
|
|
|
station: string
|
|
|
|
}
|
|
|
|
export interface CustomCraftingRecipeItem {
|
|
|
|
id: number,
|
|
|
|
item: number,
|
|
|
|
quantity: number,
|
|
|
|
type: 'input' | 'output' | 'requirement'
|
2023-11-10 22:41:42 +01:00
|
|
|
}
|