logchannel command
This commit is contained in:
parent
d8365128fc
commit
082bfe6097
@ -5,16 +5,16 @@ services:
|
||||
build: ./
|
||||
depends_on:
|
||||
- database
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TOKEN=$TOKEN
|
||||
- DB_HOST=database:5432
|
||||
- DB_HOST=database
|
||||
- DB_USERNAME=$DB_USERNAME
|
||||
- DB_PASSWORD=$DB_PASSWORD
|
||||
- DB_DATABASE=$DB_DATABASE
|
||||
database:
|
||||
image: postgres:latest
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 5432:5432
|
||||
environment:
|
||||
|
5
index.ts
5
index.ts
@ -4,10 +4,13 @@ import swapConsole from "./src/tools/consoleSwapper";
|
||||
config();
|
||||
swapConsole();
|
||||
|
||||
import "./src/client";
|
||||
import "./src/client/init";
|
||||
import "./src/commands";
|
||||
import client from "./src/client";
|
||||
|
||||
function shutdown() {
|
||||
console.log("Shutdown request received");
|
||||
if (client) client.destroy();
|
||||
process.exit();
|
||||
}
|
||||
|
||||
|
16
package-lock.json
generated
16
package-lock.json
generated
@ -18,6 +18,7 @@
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/node": "^18.11.9",
|
||||
"rimraf": "^3.0.2",
|
||||
"shx": "^0.3.4",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.3"
|
||||
@ -1029,6 +1030,21 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
|
@ -27,6 +27,7 @@
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/node": "^18.11.9",
|
||||
"rimraf": "^3.0.2",
|
||||
"shx": "^0.3.4",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.3"
|
||||
|
@ -6,15 +6,4 @@ const client = new Client({
|
||||
]
|
||||
});
|
||||
|
||||
const token = process.env["TOKEN"];
|
||||
if (!token) throw new ReferenceError("TOKEN environment variable is missing");
|
||||
|
||||
client.login(token);
|
||||
|
||||
client.on("ready", () => {
|
||||
console.log(`Connected to Discord API. Bot account is ${client.user?.tag} (${client.user?.id})`);
|
||||
});
|
||||
|
||||
export default client;
|
||||
|
||||
import "../commands";
|
10
src/client/init.ts
Normal file
10
src/client/init.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import client from "./index";
|
||||
|
||||
const token = process.env["TOKEN"];
|
||||
if (!token) throw new ReferenceError("TOKEN environment variable is missing");
|
||||
|
||||
client.login(token);
|
||||
|
||||
client.on("ready", () => {
|
||||
console.log(`Connected to Discord API. Bot account is ${client.user?.tag} (${client.user?.id})`);
|
||||
});
|
@ -28,4 +28,6 @@ const dataSource = new DataSource({
|
||||
migrationsTransactionMode: "each"
|
||||
});
|
||||
|
||||
dataSource.initialize();
|
||||
|
||||
export default dataSource;
|
@ -15,7 +15,7 @@
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
"experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
"emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||
|
Loading…
Reference in New Issue
Block a user