Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
28fd90b
updated imports and configs
commonly-ts Aug 5, 2026
6ac4170
fix: added data\ to gitignore
commonly-ts Aug 5, 2026
9f4058d
dev: updated runtime testing code
commonly-ts Aug 5, 2026
f454a61
removed data
commonly-ts Aug 5, 2026
c6b5c99
dev: updated test code and data
commonly-ts Aug 5, 2026
86c1955
fix: added proper return type to importFile
commonly-ts Aug 5, 2026
04d07ed
feat(commands): added message commands
commonly-ts Aug 5, 2026
f7ac8a7
feat(events): added messageCreate preset event
commonly-ts Aug 5, 2026
527c687
feat(events): added conditions
commonly-ts Aug 5, 2026
c2684cf
fix: fixed typos
commonly-ts Aug 5, 2026
cd356a7
fix(debug): added debug logs for message cmd alises
commonly-ts Aug 5, 2026
370ac19
dev: updated test behaviour
commonly-ts Aug 5, 2026
f052d5d
fix: normalised MessageCommandData attributes
commonly-ts Aug 6, 2026
bbbc92b
WIP: message command permissions and flags logic
commonly-ts Aug 6, 2026
e716ed5
chore: clarified debug log for preset event registration
commonly-ts Aug 6, 2026
94bd74c
fix: added message commands to permissions util funcs
commonly-ts Aug 6, 2026
4ae709a
fix: changed #src path to #trivious
commonly-ts Aug 7, 2026
b4e9fac
fix: moved slash command methods into own handler file
commonly-ts Aug 7, 2026
be8a0b2
updated import path
commonly-ts Aug 7, 2026
774553c
updated msg command types
commonly-ts Aug 9, 2026
296d8cb
updated test data
commonly-ts Aug 9, 2026
bf8249f
message command util functions
commonly-ts Aug 9, 2026
7d5b206
wip message command handler
commonly-ts Aug 9, 2026
ceda7ef
improved order of import paths
commonly-ts Aug 9, 2026
f72c5c3
tests: updated test files
commonly-ts Aug 9, 2026
36ff67d
reorganised messageCreate
commonly-ts Aug 9, 2026
37c8aff
delimiter not needed for now
commonly-ts Aug 9, 2026
6815e36
fixed typo
commonly-ts Aug 9, 2026
38d3880
updated logic for msg command presets
commonly-ts Aug 9, 2026
7b1516b
feat: help preset msg command
commonly-ts Aug 9, 2026
7848d00
updated message commands
commonly-ts Aug 9, 2026
26aa15b
minor issues fixes
commonly-ts Aug 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm run lint

- name: Type Check
run: pnpm typecheck

Expand Down
26 changes: 6 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,14 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

// updated 2026-04-20 00:47
// https://github.com/antfu/vscode-file-nesting-config
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
".env": "*.env, .env.*, .envrc, env.d.ts",
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .lfsconfig, .mailmap, .git-blame*",
"package.json": "tsconfig.json, *.code-workspace, .browserslist*, .circleci*, .commitlint*, .cspell*, .cursor*, .cz-config.js, .czrc, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitmojirc.json, .gitpod*, .huskyrc*, .jslint*, .knip.*, .lintstagedrc*, .ls-lint.yml, .markdownlint*, .node-version, .nodemon*, .npm*, .nvmrc, .oxfmtrc.json, .oxfmtrc.json.bak, .oxfmtrc.jsonc, .oxlintrc.json, .oxlintrc.json.bak, .oxlintrc.jsonc, .pm2*, .pnp.*, .pnpm*, .prettier*, .pylintrc, .release-please*.json, .releaserc*, .ruff.toml, .sentry*, .shellcheckrc, .simple-git-hooks*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .windsurfrules, .xo-config*, .yamllint*, .yarnrc*, Procfile, alejandra.toml, apollo.config.*, appveyor*, azure-pipelines*, biome.json*, bower.json, build.config.*, bun.lock, bun.lockb, bunfig.toml, colada.options.ts, commitlint*, crowdin*, cspell*, cz.config.*, dangerfile*, dlint.json, dprint.json*, ec.config.*, electron-builder.*, eslint*, firebase.json, grunt*, gulp*, jenkins*, knip.*, lefthook.*, lerna*, lint-staged*, nest-cli.*, netlify*, nixpacks*, nodemon*, npm-shrinkwrap.json, nx.*, oxfmt.config.*, oxlint.config.*, package-lock.json, package.nls*.json, phpcs.xml, pm2.*, pnpm*, prettier*, pullapprove*, pyrightconfig.json, release-please*.json, release-tasks.sh, release.config.*, renovate*, rolldown.config.*, rollup.config.*, rspack*, ruff.toml, sentry.*.config.ts, simple-git-hooks*, sonar-project.properties, stylelint*, taze.config.*, tsdown.config.*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, webpack*, workspace.json, wrangler.*, xo.config.*, yarn*",
"readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, CONTRIBUTORS.MD, CONTRIBUTORS.TXT, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Contributors.md, Contributors.txt, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE, LICENSE.MD, LICENSE.txt, License, License.md, License.txt, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, contributors.md, contributors.txt, copying*, credits, governance.md, history.md, license, license.md, license.txt, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*",
"Readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, CONTRIBUTORS.MD, CONTRIBUTORS.TXT, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Contributors.md, Contributors.txt, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE, LICENSE.MD, LICENSE.txt, License, License.md, License.txt, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, contributors.md, contributors.txt, copying*, credits, governance.md, history.md, license, license.md, license.txt, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*",
"README*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, CONTRIBUTORS.MD, CONTRIBUTORS.TXT, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Contributors.md, Contributors.txt, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE, LICENSE.MD, LICENSE.txt, License, License.md, License.txt, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, contributors.md, contributors.txt, copying*, credits, governance.md, history.md, license, license.md, license.txt, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*",
"tsconfig.json": "tsconfig*.tsbuildinfo, tsconfig.*.json",
"vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*",
"*.cjs": "$(capture).cjs.map, $(capture).*.cjs, $(capture)_*.cjs",
"*.component.ts": "$(capture).component.html, $(capture).component.spec.ts, $(capture).component.css, $(capture).component.scss, $(capture).component.sass, $(capture).component.less",
"*.js": "$(capture).js.map, $(capture).*.js, $(capture)_*.js, $(capture).d.ts, $(capture).d.ts.map, $(capture).js.flow",
"*.jsx": "$(capture).js, $(capture).*.jsx, $(capture)_*.js, $(capture)_*.jsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts",
"*.md": "$(capture).*",
"*.mjs": "$(capture).mjs.map, $(capture).*.mjs, $(capture)_*.mjs",
"*.module.ts": "$(capture).resolver.ts, $(capture).controller.ts, $(capture).service.ts",
"*.mts": "$(capture).mts.map, $(capture).*.mts, $(capture)_*.mts",
"*.ts": "$(capture).js, $(capture).d.ts.map, $(capture).*.ts, $(capture)_*.js, $(capture)_*.ts",
"*.tsx": "$(capture).ts, $(capture).*.ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts, $(capture).css.ts"
"*.ts": "${capture}.js, ${capture}.*.ts",
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
"*.jsx": "${capture}.js",
"*.tsx": "${capture}.ts",
"tsconfig.json": "tsconfig.*.json",
"package.json": "package-lock.json, pnpm-lock.yaml"
}
}
22 changes: 17 additions & 5 deletions dev/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import { TriviousClient } from "@typings";
import { TriviousClient } from "#typings";
import { GatewayIntentBits } from "discord.js";

const client = new TriviousClient({
corePath: "tests/data",
intents: [],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
credentials: {
clientIdReference: "",
tokenReference: "",
clientIdReference: "CLIENT_ID",
tokenReference: "BOT_TOKEN",
},
messageCommands: {
prefix: "?",
// delimiter: ['"', "#"],
},
debug: true,
});

(async () => {
await client.register();
// await client.register();
// console.log(client.stores.commands.message);
await client.start(false);
})();
71 changes: 0 additions & 71 deletions eslint.config.mjs

This file was deleted.

17 changes: 17 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";

export default defineConfig([
{
files: ["**/*.{mjs,cjs,ts,mts,cts}"],
ignores: ["lib/**", "node_modules/**", "dist/**", ".d.ts", "old/**/*"],
plugins: { js },
extends: ["js/recommended"],
languageOptions: { globals: globals.browser },
},
tseslint.configs.recommended,
tseslint.configs.strict,
tseslint.configs.stylistic,
]);
22 changes: 13 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,24 @@
"typescript-discord"
],
"license": "Apache-2.0",
"packageManager": "pnpm@11.8.0",
"packageManager": "pnpm@11.20.0",
"publishConfig": {
"access": "public"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"imports": {
"#typings": "./lib/shared/typings.js",
"#trivious": "./lib/index.js",
"#trivious/*": "./lib/*",
"#shared/*": "./lib/shared/*",
"#feature/*": "./lib/features/*",
"#utility/*": "./lib/utility/*"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
}
},
Expand All @@ -41,12 +48,11 @@
"url": "https://github.com/commonly-ts/trivious/issues"
},
"scripts": {
"build": "tsup && tsc-alias",
"lint": "eslint --fix src",
"build": "tsup",
"format": "prettier --write src",
"typecheck": "tsc --noEmit",
"test": "vitest",
"dev": "tsx dev/index.ts",
"dev": "tsx --env-file=dev/.env dev/index.ts",
"coverage": "vitest run --coverage",
"release": "semantic-release",
"prepare": "npm run build"
Expand All @@ -63,24 +69,22 @@
"@typescript-eslint/parser": "^8.57.0",
"@vitest/coverage-v8": "^4.1.7",
"dotenv": "^17.2.3",
"eslint": "^9.39.1",
"eslint": "^10.7.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.5",
"globals": "^17.9.0",
"jsdoc": "^4.0.5",
"prettier": "^3.6.2",
"semantic-release": "^25.0.2",
"tsc-alias": "^1.8.16",
"tsup": "^8.5.1",
"tsx": "^4.22.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.57.0",
"vite": "^8.0.14",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.1.7"
},
"dependencies": {
"chalk": "^5.6.2",
"discord.js": "^14.27.0"
}
}
Loading
Loading