Skip to content

Commit

Permalink
feat(commands): Enhance command system and improve documentation
Browse files Browse the repository at this point in the history
- Refactored command structure for better maintainability and performance
- Improved command registration and execution handling
- Added support for dynamic command contexts and arguments
- Implemented detailed inline documentation for each command
- Updated project documentation to reflect new command system changes
- Enhanced error handling and logging for easier debugging
  • Loading branch information
GrishMahat committed Sep 30, 2024
1 parent cb324b2 commit 85a4d19
Show file tree
Hide file tree
Showing 146 changed files with 17,305 additions and 12,588 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ dist
src/config/config.json
my/
.vscode/

.idea
src/config/config.js
package-lock.json
24 changes: 12 additions & 12 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"printWidth": 80,
"tabWidth": 3,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "ignore"
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "ignore"
}
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ package-lock.json
package.json
SECURITY.md
```

## Authors

- [@GrishMahat](https://github.com/GrishMahat)
Expand All @@ -46,27 +47,29 @@ SECURITY.md
## Contributing

#### 1. Fork the repository.

#### 2. Create a New Branch

```bash
git checkout -b feature/your-feature-name
```

#### 3. Commit Your Changes

## Usage

```bash
git commit -m "Add some feature"
```

#### 4. Push to the Branch

```bash
git push origin feature/your-feature-name
```

#### 5. Open a Pull Request.

## License

This project is licensed under the MIT License. ![MIT License](https://img.shields.io/badge/License-MIT-green.svg)



44 changes: 44 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { ESLint } from 'eslint';
import globals from 'globals';
import pluginJs from '@eslint/js';
import eslintPluginImport from 'eslint-plugin-import';

const eslint = new ESLint({
overrideConfig: {
env: {
node: true, // Specify that the environment is Node.js
es2021: true, // Use ES2021 features
},

parserOptions: {
ecmaVersion: 2021, // Use modern ECMAScript features
sourceType: 'module', // Allow using imports
},
rules: {
'no-unused-vars': 'warn',
'import/no-unresolved': 'error',
'prefer-const': 'error',
eqeqeq: ['error', 'always'],
curly: ['error', 'all'],
'arrow-body-style': ['error', 'as-needed'],
'consistent-return': 'error',
indent: ['error', 2], // Enforce consistent indentation (2 spaces)
'linebreak-style': ['error', 'unix'], // Enforce consistent linebreak style
'no-console': ['warn', { allow: ['warn', 'error'] }], // Allow console.warn and console.error
quotes: ['error', 'single'], // Enforce the use of single quotes
'object-curly-spacing': ['error', 'always'], // Enforce consistent spacing inside braces
semi: ['error', 'always'], // Enforce semi-colons
'comma-dangle': ['error', 'es5'], // Enforce trailing commas where valid in ES5
'space-before-function-paren': ['error', 'always'], // Enforce consistent spacing before function parentheses
'keyword-spacing': ['error', { before: true, after: true }], // Enforce consistent spacing around keywords
'no-shadow': 'error', // Disallow variable declarations from shadowing outer scope declarations
'prefer-template': 'error', // Prefer template literals over string concatenation
'array-callback-return': 'error', // Ensure return statements in callbacks of array methods
'callback-return': ['error', ['callback', 'cb']], // Require return statements after callbacks
'consistent-this': ['error', 'self'], // Enforce a consistent naming for `this`
'handle-callback-err': 'error', // Require error handling in callbacks
},
},
});

export default eslint;
100 changes: 60 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,62 @@
{
"name": "clienterrverse_economy",
"version": "2.0.0",
"main": "src/index.js",
"type": "module",
"scripts": {
"start": "node --no-warnings src/index.js",
"dev": "nodemon src/index.js",
"pre": "npx prettier --write ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/clienterrverse/clienterrverse_economy.git"
},
"author": ".clienterr",
"license": "ISC",
"bugs": {
"url": "https://github.com/clienterrverse/clienterrverse_economy/issues"
},
"homepage": "https://github.com/clienterrverse/clienterrverse_economy#readme",
"description": "",
"dependencies": {
"@napi-rs/canvas": "^0.1.53",
"axios": "^1.7.2",
"bottleneck": "^2.19.5",
"colors": "^1.4.0",
"date-fns": "^3.6.0",
"discord-arts": "^0.6.1",
"discord-html-transcripts": "^3.2.0",
"discord-image-generation": "^1.4.25",
"discord.js": "^14.16.1",
"mathjs": "^13.0.3",
"mongoose": "^8.5.2",
"ms": "^2.1.3",
"os": "^0.1.2"
},
"devDependencies": {
"dotenv": "^16.4.5",
"nodemon": "^3.1.1",
"prettier": "3.3.3"
}
"name": "clienterrverse_economy",
"version": "2.0.0",
"main": "src/index.js",
"type": "module",
"scripts": {
"start": "node --no-warnings src/index.js",
"dev": "nodemon src/index.js",
"pre": "npx prettier --write .",
"lint": "npx eslint . --fix",
"precommit": "lint-staged",
"prettify": "npx prettier --write .",
"check-deps": "npm-check-updates",
"update-deps": "npm-check-updates -u && npm install"
},
"repository": {
"type": "git",
"url": "git+https://github.com/clienterrverse/clienterrverse_economy.git"
},
"author": ".clienterr",
"license": "ISC",
"bugs": {
"url": "https://github.com/clienterrverse/clienterrverse_economy/issues"
},
"homepage": "https://github.com/clienterrverse/clienterrverse_economy#readme",
"description": "",
"dependencies": {
"@eslint/eslintrc": "^3.1.0",
"@napi-rs/canvas": "^0.1.56",
"anime-wallpaper": "^3.2.1",
"axios": "^1.7.7",
"bottleneck": "^2.19.5",
"canvas": "^2.11.2",
"colors": "^1.4.0",
"crypto": "^1.0.1",
"date-fns": "^4.1.0",
"discord-arts": "^0.6.1",
"discord-html-transcripts": "^3.2.0",
"discord-image-generation": "^1.4.25",
"discord.js": "^14.16.2",
"dotenv": "^16.4.5",
"file-type": "^19.5.0",
"mathjs": "^13.1.1",
"mongoose": "^8.6.3",
"ms": "^2.1.3",
"os": "^0.1.2",
"perf_hooks": "^0.0.1",
"random-anime": "^1.0.6",
"undici": ">=6.19.8",
"uuid": "^10.0.0"
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"eslint": "^8.50.0",
"eslint-plugin-import": "^2.30.0",
"globals": "^15.9.0",
"lint-staged": "^15.2.10",
"nodemon": "^3.1.7",
"npm-check-updates": "^17.1.3",
"prettier": "^3.3.3"
}
}
82 changes: 41 additions & 41 deletions src/assets/graphql/Recommendation.graphql
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
query ($page: Int = 0, $amount: Int = 50, $watched: [Int!]!, $nextDay: Int!) {
Page(page: $page, perPage: $amount) {
pageInfo {
currentPage
hasNextPage
}
Recommendation(
notYetAired: false
mediaId_in: $watched
sort: TIME
airingAt_lesser: $nextDay
) {
media {
id
siteUrl
format
duration
episodes
title {
romaji
}
coverImage {
large
color
}
externalLinks {
site
url
}
studios(isMain: true) {
edges {
isMain
node {
name
}
}
Page(page: $page, perPage: $amount) {
pageInfo {
currentPage
hasNextPage
}
Recommendation(
notYetAired: false
mediaId_in: $watched
sort: TIME
airingAt_lesser: $nextDay
) {
media {
id
siteUrl
format
duration
episodes
title {
romaji
}
coverImage {
large
color
}
externalLinks {
site
url
}
studios(isMain: true) {
edges {
isMain
node {
name
}
}
episode
airingAt
timeUntilAiring
id
}
}
}
}
episode
airingAt
timeUntilAiring
id
}
}
}
82 changes: 41 additions & 41 deletions src/assets/graphql/Schedule.graphql
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
query ($page: Int = 0, $amount: Int = 50, $watched: [Int!]!, $nextDay: Int!) {
Page(page: $page, perPage: $amount) {
pageInfo {
currentPage
hasNextPage
}
airingSchedules(
notYetAired: true
mediaId_in: $watched
sort: TIME
airingAt_lesser: $nextDay
) {
media {
id
siteUrl
format
duration
episodes
title {
romaji
}
coverImage {
large
color
}
externalLinks {
site
url
}
studios(isMain: true) {
edges {
isMain
node {
name
}
}
Page(page: $page, perPage: $amount) {
pageInfo {
currentPage
hasNextPage
}
airingSchedules(
notYetAired: true
mediaId_in: $watched
sort: TIME
airingAt_lesser: $nextDay
) {
media {
id
siteUrl
format
duration
episodes
title {
romaji
}
coverImage {
large
color
}
externalLinks {
site
url
}
studios(isMain: true) {
edges {
isMain
node {
name
}
}
episode
airingAt
timeUntilAiring
id
}
}
}
}
episode
airingAt
timeUntilAiring
id
}
}
}
Loading

0 comments on commit 85a4d19

Please sign in to comment.