-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbb6db0
commit 4eec9f4
Showing
5 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"botId": "1168822115810672711", | ||
"botSecret": "", | ||
"botToken": "", | ||
|
||
"port": 25527, | ||
|
||
"userAgent": "DiscordBot (https://disgithook.tomatenkuchen.com, v1.0.0)", | ||
|
||
"db": { | ||
"host": "", | ||
"user": "", | ||
"password": "", | ||
"database": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const { db } = require("../config.json") | ||
|
||
const mysql = require("mysql2") | ||
const mainDB = mysql.createPool(db) | ||
|
||
const pool = mainDB.promise() | ||
module.exports = pool | ||
|
||
// hook schema: id secret guild webhook? channel? name? avatar? message | ||
pool.query( | ||
"CREATE TABLE IF NOT EXISTS `hook` (" + | ||
"`id` VARCHAR(8) NOT NULL PRIMARY KEY," + | ||
"`secret` VARCHAR(64) NOT NULL," + | ||
"`guild` VARCHAR(21) NOT NULL," + | ||
"`webhook` VARCHAR(128) NOT NULL," + | ||
"`channel` VARCHAR(21) NOT NULL," + | ||
"`name` VARCHAR(32) NOT NULL," + | ||
"`avatar` VARCHAR(512) NOT NULL," + | ||
"`message` VARCHAR(10240) NOT NULL" + | ||
")" | ||
) | ||
|
||
// user schema: user token access refresh expires | ||
pool.query( | ||
"CREATE TABLE IF NOT EXISTS `user` (" + | ||
"`id` VARCHAR(21) NOT NULL PRIMARY KEY," + | ||
"`token` VARCHAR(64) NOT NULL," + | ||
"`access` VARCHAR(64) NOT NULL," + | ||
"`refresh` VARCHAR(64) NOT NULL," + | ||
"`expires` BIGINT NOT NULL" + | ||
")" | ||
) |