@somehiddenkey/discord-command-utils 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@somehiddenkey/discord-command-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A utility library for building Discord bot commands using discord.js",
5
5
  "author": {
6
6
  "email": "k3y.throwaway@gmail.com",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "license": "ISC",
10
10
  "type": "module",
11
- "main": "index.js",
11
+ "main": "src/index.js",
12
12
  "scripts": {
13
13
  "test": "echo \"Error: no test specified\" && exit 1"
14
14
  },
@@ -1,8 +1,6 @@
1
- class ConfigError extends Error {
1
+ export default class ConfigError extends Error {
2
2
  constructor(message) {
3
3
  super(message);
4
4
  this.name = "ConfigError";
5
5
  }
6
- }
7
-
8
- export default ConfigError;
6
+ }
@@ -3,9 +3,9 @@
3
3
  */
4
4
 
5
5
  import fs from 'fs';
6
- import ConfigError from "./ConfigError";
6
+ import ConfigError from "./ConfigError.js";
7
7
  import consola from 'consola';
8
- import { InteractionScope } from "../Utils/enums";
8
+ import { InteractionScope } from "../Utils/enums.js";
9
9
 
10
10
  export default class GlobalConfig {
11
11
  /** @type {Guilds} */
@@ -2,9 +2,6 @@
2
2
  * @typedef {string} Snowflake
3
3
  */
4
4
 
5
- import { RESTOptions } from '@discordjs/rest';
6
- import { ActivitiesOptions } from 'discord.js';
7
-
8
5
  export default class LocalConfig {
9
6
  /** @type {string?} */
10
7
  prefix;
@@ -13,9 +10,9 @@ export default class LocalConfig {
13
10
 
14
11
  /** @type {object} */
15
12
  local;
16
- /** @type {Partial<RESTOptions>} */
13
+ /** @type {object} */
17
14
  restOptions;
18
- /** @type {ActivitiesOptions} */
15
+ /** @type {object} */
19
16
  activity;
20
17
 
21
18
  constructor(data) {
@@ -1,5 +1,5 @@
1
1
  import consola from "consola";
2
- import ConfigError from "./ConfigError";
2
+ import ConfigError from "./ConfigError.js";
3
3
 
4
4
  /**
5
5
  * @typedef {{client: string, connection: {host: string, user: string, password: string, database: string}}} DatabaseConfig
@@ -1,4 +1,5 @@
1
- import { Interaction as DiscordBaseInteraction, MessageFlags } from "discord.js";
1
+ import pkg from 'discord.js';
2
+ const { Interaction: DiscordBaseInteraction } = pkg;
2
3
 
3
4
  export default class CommandError extends Error {
4
5
  constructor(message) {
@@ -1,15 +1,16 @@
1
- import {
2
- Interaction as DiscordBaseInteraction,
1
+ import InteractionContainer from "./InteractionContainer.js";
2
+ import { InteractionType, InteractionScope } from "../Utils/enums.js";
3
+ import pkg from 'discord.js';
4
+
5
+ const {
6
+ Interaction: DiscordBaseInteraction,
3
7
  OmitPartialGroupDMChannel,
4
8
  Message,
5
9
  ModalSubmitInteraction,
6
10
  ButtonInteraction,
7
11
  AnySelectMenuInteraction,
8
12
  ChatInputCommandInteraction,
9
- CacheType
10
- } from 'discord.js';
11
- import InteractionContainer from "./InteractionContainer";
12
- import { InteractionType, InteractionScope } from "../Utils/enums";
13
+ CacheType } = pkg;
13
14
 
14
15
  /**
15
16
  * @typedef { (interaction: DiscordBaseInteraction<CacheType>) => Promise<any> } InteractionFunction
@@ -1,16 +1,17 @@
1
- import {
2
- Interaction as DiscordBaseInteraction,
1
+ import Interaction from "./Interaction.js";
2
+ import { InteractionScope, InteractionType } from "../Utils/enums.js";
3
+ import GlobalConfig from "../Configs/GlobalConfig.js";
4
+ import LocalConfig from "../Configs/LocalConfig.js";
5
+ import consola from "consola";
6
+ import CommandError from "./CommandError.js";
7
+ import RestCommands from './RestCommands.js';
8
+ import pkg from 'discord.js';
9
+ const {
10
+ Interaction: DiscordBaseInteraction,
3
11
  OmitPartialGroupDMChannel,
4
12
  Message,
5
13
  CacheType
6
- } from 'discord.js';
7
- import Interaction from "./Interaction";
8
- import { InteractionScope, InteractionType } from "../Utils/enums";
9
- import GlobalConfig from "../Configs/GlobalConfig";
10
- import LocalConfig from "../Configs/LocalConfig";
11
- import consola from "consola";
12
- import CommandError from "./CommandError";
13
- import RestCommands from './RestCommands';
14
+ } = pkg;
14
15
 
15
16
  /**
16
17
  * @typedef { (interaction: DiscordBaseInteraction<CacheType>) => Promise<any> } InteractionFunction
@@ -1,6 +1,5 @@
1
- import { InteractionScope } from "../Utils/enums";
2
- import GlobalConfig from "../Configs/GlobalConfig";
3
- import LocalConfig from "../Configs/LocalConfig";
1
+ import GlobalConfig from "../Configs/GlobalConfig.js";
2
+ import LocalConfig from "../Configs/LocalConfig.js";
4
3
  import { REST } from "discord.js";
5
4
 
6
5
  export default class RestCommands {
@@ -1,5 +1,5 @@
1
1
  import { BaseInteraction } from "discord.js";
2
- import { Modlevel } from "./enums";
2
+ import { Modlevel } from "./enums.js";
3
3
 
4
4
 
5
5
  /**