.
This commit is contained in:
parent
6fc5eae5cd
commit
1d2d6425c1
4 changed files with 4 additions and 5 deletions
|
@ -3,4 +3,4 @@ MYSQL_USER='MYSQL_USER'
|
|||
MYSQL_HOST='MYSQL_HOST'
|
||||
MYSQL_PASSWORD='MYSQL_PASSWORD'
|
||||
MYSQL_DATABASE='MYSQL_DATABASE'
|
||||
MYSQL_PORT='MYSQL_PORT'
|
||||
MYSQL_PORT='MYSQL_PORT'
|
||||
|
|
|
@ -49,7 +49,6 @@ export default class MuffinAI extends Client {
|
|||
if (msg.author.bot) return
|
||||
if (msg.content.startsWith('머핀아 ')) {
|
||||
if (msg.channel instanceof TextChannel) {
|
||||
// if (msg.channel.nsfw) return
|
||||
await msg.channel.sendTyping()
|
||||
this.chatBot //
|
||||
.getResponse(msg)
|
||||
|
@ -67,7 +66,7 @@ export default class MuffinAI extends Client {
|
|||
if (NODE_ENV === 'development') console.log(args)
|
||||
const command = this.#modules.get(args.shift()!.toLowerCase())
|
||||
if (!command) return
|
||||
if (command.noPerm && msg.author.id !== '415135882006495242')
|
||||
if (command.noPerm && msg.author.id !== process.env.OWNER_ID)
|
||||
return await noPerm(msg)
|
||||
|
||||
command.execute(msg, args)
|
||||
|
|
|
@ -31,7 +31,7 @@ export default class ChatBot {
|
|||
client.on('messageCreate', async msg => {
|
||||
if (msg.author.bot) return
|
||||
const db = await this.db
|
||||
if (msg.author.id === '1026185545837191238') {
|
||||
if (msg.author.id === process.env.TRAIN_USER_ID) {
|
||||
const response = await this.getResponse(msg)
|
||||
const [rows] = await db.execute<ResponseData[]>(
|
||||
'SELECT * FROM statement;'
|
||||
|
|
|
@ -3,7 +3,7 @@ import { createConnection } from 'mysql2/promise'
|
|||
|
||||
describe('test database system', () => {
|
||||
test('Validate rows', async () => {
|
||||
return database.getConnection().then(async conn1 => {
|
||||
return database.then(async conn1 => {
|
||||
const [rows1] = await conn1.execute('SELECT * FROM statement;')
|
||||
const conn2 = await createConnection(config)
|
||||
const [rows2] = await conn2.execute(`SELECT * FROM statement;`)
|
||||
|
|
Loading…
Reference in a new issue