core/utils/Query.ts
2021-01-05 10:31:15 +09:00

23 lines
571 B
TypeScript

import fetch from 'node-fetch'
import jwt from 'jsonwebtoken'
import fs from 'fs'
import knsexy from 'knex'
export const knex = knsexy({
client: 'mysql',
connection: {
host: process.env.MYSQL_HOST || 'localhost',
user: process.env.MYSQL_USER || 'root',
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE || 'discordbots',
},
})
export async function getBot(id: string) {}
export async function getUser(id: string) {
const res = await knex('users')
.select(['id', 'avatar', 'tag', 'username', 'perm', 'github'])
.where({ id })
}