modified docker image structure
This commit is contained in:
parent
a02979522f
commit
933d03ff13
6 changed files with 38 additions and 20 deletions
|
@ -1,4 +1,6 @@
|
|||
import * as mysql from "mysql";
|
||||
import { rejects } from "node:assert";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
export interface User {
|
||||
id: number,
|
||||
|
@ -157,3 +159,27 @@ export function setWelcomePropertiy(connection: mysql.Connection, guild_id: Stri
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getLastReset(connection: mysql.Connection) {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query("SELECT MAX(date) FROM resets", (error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
resolve(result)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function addReset(connection: mysql.Connection, date: number) {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query(`INSERT INTO resets (date) VALUES (${date})`, (error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
resolve(result)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue