fix: standardize command import paths to lowercase for consistency

This commit is contained in:
2025-05-01 17:56:55 -04:00
parent 748d438706
commit 0cd3b5c179
9 changed files with 22 additions and 9 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
import { SlashCommandBuilder } from 'discord.js'; import { SlashCommandBuilder } from 'discord.js';
import axios from 'axios'; import axios from 'axios';
import Command from '../utils/Command.js'; import Command from '../utils/command.js';
const config = { const config = {
webSearch: { webSearch: {
+1 -1
View File
@@ -7,7 +7,7 @@
// (at your option) any later version. // (at your option) any later version.
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js'; import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
import Command from '../utils/Command.js'; import Command from '../utils/command.js';
export default class HelpCommand extends Command { export default class HelpCommand extends Command {
defineCommand() { defineCommand() {
+1 -1
View File
@@ -7,7 +7,7 @@
// (at your option) any later version. // (at your option) any later version.
import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js'; import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js';
import Command from '../utils/Command.js'; import Command from '../utils/command.js';
export default class KickCommand extends Command { export default class KickCommand extends Command {
defineCommand() { defineCommand() {
+1 -1
View File
@@ -7,7 +7,7 @@
// (at your option) any later version. // (at your option) any later version.
import { SlashCommandBuilder } from 'discord.js'; import { SlashCommandBuilder } from 'discord.js';
import Command from '../utils/Command.js'; import Command from '../utils/command.js';
export default class PingCommand extends Command { export default class PingCommand extends Command {
defineCommand() { defineCommand() {
+1 -1
View File
@@ -7,7 +7,7 @@
// (at your option) any later version. // (at your option) any later version.
import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js'; import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js';
import Command from '../utils/Command.js'; import Command from '../utils/command.js';
export default class PruneCommand extends Command { export default class PruneCommand extends Command {
defineCommand() { defineCommand() {
+2 -1
View File
@@ -9,7 +9,8 @@
"deploy": "node deploy-commands.js", "deploy": "node deploy-commands.js",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"test:coverage": "jest --coverage" "test:coverage": "jest --coverage",
"deploy:ansible": "ansible-playbook -i inventory.ini playbook.yml"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
+13 -1
View File
@@ -4,12 +4,23 @@
become: yes # This enables sudo privileges become: yes # This enables sudo privileges
vars: vars:
app_dir: /opt/kekbot app_dir: /opt/kekbot
node_version: "20.x" # Latest LTS version node_version: "22.x" # Latest LTS version
tasks: tasks:
- name: Check if Node.js, npm, and git are installed
command: "which {{ item }}"
register: check_commands
with_items:
- node
- npm
- git
ignore_errors: yes
changed_when: false
- name: Install Node.js repository - name: Install Node.js repository
shell: | shell: |
curl -fsSL https://deb.nodesource.com/setup_{{ node_version }} | bash - curl -fsSL https://deb.nodesource.com/setup_{{ node_version }} | bash -
when: check_commands.results | select('failed') | list | length > 0
- name: Install Node.js, npm, and git - name: Install Node.js, npm, and git
apt: apt:
@@ -19,6 +30,7 @@
- git - git
state: present state: present
update_cache: yes update_cache: yes
when: check_commands.results | select('failed') | list | length > 0
- name: Create application directory - name: Create application directory
file: file:
+1 -1
View File
@@ -1,4 +1,4 @@
// utils/Command.js - Base command class for Discord bot commands // utils/command.js - Base command class for Discord bot commands
// Copyright (C) 2025 Luis Bauza // Copyright (C) 2025 Luis Bauza
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
+1 -1
View File
@@ -25,7 +25,7 @@ export async function loadCommands(commandsPath, logger) {
const commandModule = await import(filePath); const commandModule = await import(filePath);
const Command = commandModule.default; const Command = commandModule.default;
const CommandBase = (await import('./Command.js')).default; const CommandBase = (await import('./command.js')).default;
if (Command.prototype instanceof CommandBase) { if (Command.prototype instanceof CommandBase) {
// New style - class extending Command // New style - class extending Command
const commandInstance = new Command(); const commandInstance = new Command();