From f9ef87c1e64c8f2c0c97025627a0bb408da08a16 Mon Sep 17 00:00:00 2001 From: loopdelux <87593874+loopdelux@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:05:02 -0500 Subject: [PATCH] first commit; for some reason tsc spits out an error about some module, seems to work fine regardless --- .gitignore | 4 ++++ README | 7 +++++++ TEMPLATE_config.ts | 7 +++++++ package.json | 19 +++++++++++++++++++ src/index.ts | 14 ++++++++++++++ tsconfig.json | 16 ++++++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 .gitignore create mode 100644 README create mode 100644 TEMPLATE_config.ts create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90489b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/build/ +/config.ts +/node_modules/ +/package-lock.json diff --git a/README b/README new file mode 100644 index 0000000..906c031 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +Vanilje - Discord bot targetted at Discordjs v12 (Concordia) + +Dependencies: + o Typescript + o Concordia + +P/S: I'm a beginner at JS/TS; please excuse me for any poor decisions. Feedback is appreciated. diff --git a/TEMPLATE_config.ts b/TEMPLATE_config.ts new file mode 100644 index 0000000..6bf7fe8 --- /dev/null +++ b/TEMPLATE_config.ts @@ -0,0 +1,7 @@ +/* (TEMPLATE )Bot config file; edit this to your liking */ +/* Make sure to rename this to config.ts */ +export default +{ + token: "X", + owner: "X" +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..104f3df --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "vanilje", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.11.19", + "typescript": "^5.3.3" + }, + "dependencies": { + "concordia": "^12.5.5" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..5b581fe --- /dev/null +++ b/src/index.ts @@ -0,0 +1,14 @@ +/* Starting point of the entire program */ + +import cfg from "../config"; +import { ActivityType, Client } from "concordia"; +const client = new Client(); + +function onReady() +{ + console.log("Logged in!"); +} + +client.on("ready", onReady); + +client.login(cfg.token); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..35190ae --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": + { + "target": "es2020", + "module": "commonjs", + "outDir": "build/", + "esModuleInterop": true, + "strict": true + }, + + "include": + [ + "src/**/*", + "config.json" + ] +}