-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
0 parents
commit 9cdc3d4
Showing
29 changed files
with
3,708 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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 @@ | ||
DISCORD_TOKEN= |
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,61 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"ignorePatterns": ["dist"], | ||
"plugins": ["simple-import-sort", "unused-imports"], | ||
"rules": { | ||
"quotes": ["error", "double", { "avoidEscape": true }], | ||
"jsx-quotes": ["error", "prefer-double"], | ||
"no-mixed-spaces-and-tabs": "error", | ||
"arrow-parens": ["error", "as-needed"], | ||
"eol-last": ["error", "always"], | ||
"func-call-spacing": ["error", "never"], | ||
"no-multi-spaces": "error", | ||
"no-trailing-spaces": "error", | ||
"no-whitespace-before-property": "error", | ||
"semi": ["error", "always"], | ||
"semi-style": ["error", "last"], | ||
"space-in-parens": ["error", "never"], | ||
"block-spacing": ["error", "always"], | ||
"object-curly-spacing": ["error", "always"], | ||
"eqeqeq": ["error", "always", { "null": "ignore" }], | ||
"spaced-comment": ["error", "always", { "markers": ["!"] }], | ||
"yoda": "error", | ||
"prefer-destructuring": ["error", { | ||
"VariableDeclarator": { "array": false, "object": true }, | ||
"AssignmentExpression": { "array": false, "object": false } | ||
}], | ||
"operator-assignment": ["error", "always"], | ||
"no-useless-computed-key": "error", | ||
"no-unneeded-ternary": ["error", { "defaultAssignment": false }], | ||
"no-invalid-regexp": "error", | ||
"no-constant-condition": ["error", { "checkLoops": false }], | ||
"no-duplicate-imports": "error", | ||
"no-extra-semi": "error", | ||
"dot-notation": "error", | ||
"no-useless-escape": "error", | ||
"no-fallthrough": "error", | ||
"for-direction": "error", | ||
"no-async-promise-executor": "error", | ||
"no-cond-assign": "error", | ||
"no-dupe-else-if": "error", | ||
"no-duplicate-case": "error", | ||
"no-irregular-whitespace": "error", | ||
"no-loss-of-precision": "error", | ||
"no-misleading-character-class": "error", | ||
"no-prototype-builtins": "error", | ||
"no-regex-spaces": "error", | ||
"no-shadow-restricted-names": "error", | ||
"no-unexpected-multiline": "error", | ||
"no-unsafe-optional-chaining": "error", | ||
"no-useless-backreference": "error", | ||
"use-isnan": "error", | ||
"prefer-const": "error", | ||
"prefer-spread": "error", | ||
|
||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
|
||
"unused-imports/no-unused-imports": "error" | ||
} | ||
} |
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 @@ | ||
* text=auto eol=lf |
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,5 @@ | ||
dist | ||
node_modules | ||
.env | ||
|
||
sqlite.db |
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 @@ | ||
# Venniepoints | ||
|
||
Venniepoints is a Discord bot used on the [Vencord](https://vencord.dev) Discord server for experience points! | ||
|
||
This bot is extremely specific and not configurable so there is really no reason for you to want to self host it | ||
|
||
Nevertheless it is still available under a free software license so you can easily audit and modify it! |
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,50 @@ | ||
import esbuild from "esbuild"; | ||
import { readdir } from "fs/promises"; | ||
|
||
/** | ||
* @type {esbuild.Plugin} | ||
*/ | ||
const makeAllPackagesExternalPlugin = { | ||
name: "make-all-packages-external", | ||
setup(build) { | ||
const filter = /^[^./]|^\.[^./]|^\.\.[^/]/; // Must not start with "/" or "./" or "../" | ||
build.onResolve({ filter }, args => ({ path: args.path, external: true })); | ||
}, | ||
}; | ||
|
||
/** | ||
* @type {(namespace: string) => esbuild.Plugin} | ||
*/ | ||
const includeDirPlugin = namespace => ({ | ||
name: `include-dir-plugin:${namespace}`, | ||
setup(build) { | ||
const filter = new RegExp(`^~${namespace}$`); | ||
const dir = `./src/${namespace}`; | ||
|
||
build.onResolve( | ||
{ filter }, | ||
args => ({ path: args.path, namespace }) | ||
); | ||
|
||
build.onLoad({ filter, namespace }, async () => { | ||
const files = await readdir(dir); | ||
return { | ||
contents: files.map(f => `import "./${f.replace(".ts", "")}"`).join("\n"), | ||
resolveDir: dir | ||
}; | ||
}); | ||
} | ||
}); | ||
|
||
await esbuild.build({ | ||
entryPoints: ["src/index.ts"], | ||
bundle: true, | ||
plugins: [includeDirPlugin("commands"), includeDirPlugin("modules"), makeAllPackagesExternalPlugin], | ||
outfile: "dist/index.js", | ||
minify: false, | ||
treeShaking: true, | ||
target: "esnext", | ||
platform: "node", | ||
sourcemap: "linked", | ||
logLevel: "info" | ||
}); |
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,11 @@ | ||
import { defineConfig } from "drizzle-kit"; | ||
|
||
export default defineConfig({ | ||
schema: "./src/schema.ts", | ||
dialect: "sqlite", | ||
dbCredentials: { | ||
url: "./sqlite.db" | ||
}, | ||
verbose: true, | ||
strict: true | ||
}); |
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,4 @@ | ||
CREATE TABLE `users` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`xp` integer NOT NULL | ||
); |
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,40 @@ | ||
{ | ||
"version": "6", | ||
"dialect": "sqlite", | ||
"id": "60b22056-c5e2-44b5-b23b-6c7f9daa0730", | ||
"prevId": "00000000-0000-0000-0000-000000000000", | ||
"tables": { | ||
"users": { | ||
"name": "users", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"xp": { | ||
"name": "xp", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
}, | ||
"internal": { | ||
"indexes": {} | ||
} | ||
} |
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,13 @@ | ||
{ | ||
"version": "7", | ||
"dialect": "sqlite", | ||
"entries": [ | ||
{ | ||
"idx": 0, | ||
"version": "6", | ||
"when": 1717336720864, | ||
"tag": "0000_sharp_vindicator", | ||
"breakpoints": true | ||
} | ||
] | ||
} |
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,39 @@ | ||
{ | ||
"name": "venniepoints", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"start": "pnpm build && node . VENNIE", | ||
"build": "node build.mjs", | ||
"test": "pnpm lint && pnpm testTypes", | ||
"testTypes": "tsc --noEmit", | ||
"lint": "eslint . --ext .js,.ts", | ||
"lint:fix": "pnpm lint --fix", | ||
"db:generate": "drizzle-kit generate", | ||
"db:migrate": "tsx ./src/migrate.ts" | ||
}, | ||
"keywords": [], | ||
"author": "lewisakura <[email protected]>", | ||
"dependencies": { | ||
"better-sqlite3": "^11.0.0", | ||
"dotenv": "^16.4.5", | ||
"drizzle-orm": "^0.31.0", | ||
"execa": "^8.0.1", | ||
"oceanic.js": "1.10.4", | ||
"pako": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/better-sqlite3": "^7.6.10", | ||
"@types/node": "^20.12.7", | ||
"@typescript-eslint/parser": "^7.7.0", | ||
"drizzle-kit": "^0.22.1", | ||
"esbuild": "^0.20.2", | ||
"eslint": "^8.46.0", | ||
"eslint-plugin-simple-import-sort": "^12.1.0", | ||
"eslint-plugin-unused-imports": "^3.1.0", | ||
"tslib": "^2.6.2", | ||
"tsx": "^4.11.0", | ||
"typescript": "^5.4.5" | ||
} | ||
} |
Oops, something went wrong.