jillo-bot/src/lib/db.ts

43 lines
769 B
TypeScript
Raw Normal View History

import knex from 'knex';
2023-11-11 01:54:11 +01:00
import * as log from './log';
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
}
});
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 {
key: string,
name: string,
emoji: string,
value: number,
channel: string,
guild: string,
message?: string,
2023-11-12 19:45:23 +01:00
messageTemplate?: string,
allowlistConsumer: boolean,
allowlistProducer: boolean
2023-11-11 00:01:38 +01:00
}
2023-11-12 19:45:23 +01:00
export interface CounterUserLink {
key: string,
user: string,
producer: boolean
}