@somehiddenkey/discord-command-utils 2.1.1 → 2.1.2

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": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "A utility library for building Discord bot commands using discord.js",
5
5
  "author": {
6
6
  "email": "k3y.throwaway@gmail.com",
@@ -5,17 +5,21 @@
5
5
  import fs from 'fs';
6
6
  import consola from 'consola';
7
7
  import { InteractionScope } from "../../Utils/enums.js";
8
- import {default as GuildMain} from './GlobalConfigMain.js';
9
- import {default as GuildCommunity} from './GlobalConfigCommunity.js';
10
- import {default as GuildTutor} from './GlobalConfigTutor.js';
11
- import {default as GuildStaff} from './GlobalConfigStaff.js';
8
+ import GuildMain from './GlobalConfigMain.js';
9
+ import GuildCommunity from './GlobalConfigCommunity.js';
10
+ import GuildTutor from './GlobalConfigTutor.js';
11
+ import GuildStaff from './GlobalConfigStaff.js';
12
12
  import { GuildBased } from '../NestedGlobalConfig.js';
13
13
  import { Client } from 'discord.js';
14
14
 
15
15
  export default class GlobalConfig {
16
+ /** @type {GuildMain} */
16
17
  main
18
+ /** @type {GuildCommunity} */
17
19
  community
20
+ /** @type {GuildTutor} */
18
21
  tutor
22
+ /** @type {GuildStaff} */
19
23
  staff
20
24
 
21
25
  /**
@@ -7,14 +7,14 @@ import pkg from 'discord.js';
7
7
  import { GuildBased, ChannelBased, RoleBased } from '../NestedGlobalConfig.js';
8
8
  const { GuildBasedChannel } = pkg;
9
9
 
10
- export default class Guild extends GuildBased {
11
- /** @type {Categories} */
10
+ export default class GuildCommunity extends GuildBased {
11
+ /** @type {CategoriesCommunity} */
12
12
  categories;
13
- /** @type {Channels} */
13
+ /** @type {ChannelsCommunity} */
14
14
  channels;
15
- /** @type {Logs} */
15
+ /** @type {LogsCommunity} */
16
16
  logs;
17
- /** @type {Roles} */
17
+ /** @type {RolesCommunity} */
18
18
  roles;
19
19
 
20
20
  constructor(data) {
@@ -22,17 +22,17 @@ export default class Guild extends GuildBased {
22
22
  throw new ConfigError('No data initialized for GlobalConfig');
23
23
 
24
24
  super(data);
25
- this.categories = new Categories(data.categories, data.id);
26
- this.channels = new Channels(data.channels, data.id);
27
- this.logs = new Logs(data.logs, data.id);
28
- this.roles = new Roles(data.roles, data.id);
25
+ this.categories = new CategoriesCommunity(data.categories, data.id);
26
+ this.channels = new ChannelsCommunity(data.channels, data.id);
27
+ this.logs = new LogsCommunity(data.logs, data.id);
28
+ this.roles = new RolesCommunity(data.roles, data.id);
29
29
  }
30
30
  }
31
31
 
32
- class Categories extends ChannelBased {}
32
+ class CategoriesCommunity extends ChannelBased {}
33
33
 
34
34
  class Channels extends ChannelBased {}
35
35
 
36
- class Logs extends ChannelBased {}
36
+ class LogsCommunity extends ChannelBased {}
37
37
 
38
- class Roles extends RoleBased {}
38
+ class RolesCommunity extends RoleBased {}
@@ -7,14 +7,14 @@ import pkg from 'discord.js';
7
7
  import { GuildBased, ChannelBased, RoleBased } from '../NestedGlobalConfig.js';
8
8
  const { GuildBasedChannel } = pkg;
9
9
 
10
- export default class Guild extends GuildBased {
11
- /** @type {Categories} */
10
+ export default class GuildMain extends GuildBased {
11
+ /** @type {CategoriesMain} */
12
12
  categories;
13
- /** @type {Channels} */
13
+ /** @type {ChannelsMain} */
14
14
  channels;
15
- /** @type {Logs} */
15
+ /** @type {LogsMain} */
16
16
  logs;
17
- /** @type {Roles} */
17
+ /** @type {RolesMain} */
18
18
  roles;
19
19
 
20
20
  constructor(data, bot) {
@@ -22,14 +22,14 @@ export default class Guild extends GuildBased {
22
22
  throw new ConfigError('No data initialized for GlobalConfig');
23
23
 
24
24
  super(data, bot);
25
- this.categories = new Categories(data.categories, this.guild);
26
- this.channels = new Channels(data.channels, this.guild);
27
- this.logs = new Logs(data.logs, this.guild);
28
- this.roles = new Roles(data.roles, this.guild);
25
+ this.categories = new CategoriesMain(data.categories, this.guild);
26
+ this.channels = new ChannelsMain(data.channels, this.guild);
27
+ this.logs = new LogsMain(data.logs, this.guild);
28
+ this.roles = new RolesMain(data.roles, this.guild);
29
29
  }
30
30
  }
31
31
 
32
- class Categories extends ChannelBased {
32
+ class CategoriesMain extends ChannelBased {
33
33
  /** @type {Set<Snowflake>} */
34
34
  custom_rooms;
35
35
  /** @type {Set<Snowflake>} */
@@ -72,7 +72,7 @@ class Categories extends ChannelBased {
72
72
  }
73
73
  }
74
74
 
75
- class Channels extends ChannelBased {
75
+ class ChannelsMain extends ChannelBased {
76
76
  /** @type {GuildBasedChannel} */
77
77
  timer_control;
78
78
  /** @type {GuildBasedChannel} */
@@ -101,7 +101,7 @@ class Channels extends ChannelBased {
101
101
  welcome;
102
102
  }
103
103
 
104
- class Logs extends ChannelBased {
104
+ class LogsMain extends ChannelBased {
105
105
  /** @type {GuildBasedChannel} */
106
106
  error;
107
107
  /** @type {GuildBasedChannel} */
@@ -118,7 +118,7 @@ class Logs extends ChannelBased {
118
118
  communities;
119
119
  }
120
120
 
121
- class Roles extends RoleBased {
121
+ class RolesMain extends RoleBased {
122
122
  /** @type {Snowflake} */
123
123
  cuckoo_ping;
124
124
  /** @type {Snowflake} */
@@ -7,14 +7,14 @@ import pkg from 'discord.js';
7
7
  import { GuildBased, ChannelBased, RoleBased } from '../NestedGlobalConfig.js';
8
8
  const { GuildBasedChannel } = pkg;
9
9
 
10
- export default class Guild extends GuildBased {
11
- /** @type {Categories} */
10
+ export default class GuildStaff extends GuildBased {
11
+ /** @type {CategoriesStaff} */
12
12
  categories;
13
- /** @type {Channels} */
13
+ /** @type {ChannelsStaff} */
14
14
  channels;
15
- /** @type {Logs} */
15
+ /** @type {LogsStaff} */
16
16
  logs;
17
- /** @type {Roles} */
17
+ /** @type {RolesStaff} */
18
18
  roles;
19
19
 
20
20
  constructor(data, bot) {
@@ -22,17 +22,17 @@ export default class Guild extends GuildBased {
22
22
  throw new ConfigError('No data initialized for GlobalConfig');
23
23
 
24
24
  super(data, bot);
25
- this.categories = new Categories(data.categories, data.id);
26
- this.channels = new Channels(data.channels, data.id);
27
- this.logs = new Logs(data.logs, data.id);
28
- this.roles = new Roles(data.roles, data.id);
25
+ this.categories = new CategoriesStaff(data.categories, data.id);
26
+ this.channels = new ChannelsStaff(data.channels, data.id);
27
+ this.logs = new LogsStaff(data.logs, data.id);
28
+ this.roles = new RolesStaff(data.roles, data.id);
29
29
  }
30
30
  }
31
31
 
32
- class Categories extends ChannelBased {}
32
+ class CategoriesStaff extends ChannelBased {}
33
33
 
34
- class Channels extends ChannelBased {}
34
+ class ChannelsStaff extends ChannelBased {}
35
35
 
36
- class Logs extends ChannelBased {}
36
+ class LogsStaff extends ChannelBased {}
37
37
 
38
- class Roles extends RoleBased {}
38
+ class RolesStaff extends RoleBased {}
@@ -7,14 +7,14 @@ import pkg from 'discord.js';
7
7
  import { GuildBased, ChannelBased, RoleBased } from '../NestedGlobalConfig.js';
8
8
  const { GuildBasedChannel } = pkg;
9
9
 
10
- export default class Guild extends GuildBased {
11
- /** @type {Categories} */
10
+ export default class GuildTutor extends GuildBased {
11
+ /** @type {CategoriesTutor} */
12
12
  categories;
13
- /** @type {Channels} */
13
+ /** @type {ChannelsTutor} */
14
14
  channels;
15
- /** @type {Logs} */
15
+ /** @type {LogsTutor} */
16
16
  logs;
17
- /** @type {Roles} */
17
+ /** @type {RolesTutor} */
18
18
  roles;
19
19
 
20
20
  constructor(data, bot) {
@@ -22,17 +22,17 @@ export default class Guild extends GuildBased {
22
22
  throw new ConfigError('No data initialized for GlobalConfig');
23
23
 
24
24
  super(data, bot);
25
- this.categories = new Categories(data.categories, data.id);
26
- this.channels = new Channels(data.channels, data.id);
27
- this.logs = new Logs(data.logs, data.id);
28
- this.roles = new Roles(data.roles, data.id);
25
+ this.categories = new CategoriesTutor(data.categories, data.id);
26
+ this.channels = new ChannelsTutor(data.channels, data.id);
27
+ this.logs = new LogsTutor(data.logs, data.id);
28
+ this.roles = new RolesTutor(data.roles, data.id);
29
29
  }
30
30
  }
31
31
 
32
- class Categories extends ChannelBased {}
32
+ class CategoriesTutor extends ChannelBased {}
33
33
 
34
- class Channels extends ChannelBased {}
34
+ class ChannelsTutor extends ChannelBased {}
35
35
 
36
- class Logs extends ChannelBased {}
36
+ class LogsTutor extends ChannelBased {}
37
37
 
38
- class Roles extends RoleBased {}
38
+ class RolesTutor extends RoleBased {}
@@ -27,7 +27,7 @@ export default class SecretConfig {
27
27
  this.token = env.TOKEN;
28
28
 
29
29
  var databaseConfigs = [];
30
- for (let index = 0, section = "DATABASE__"+index; !!env[section+"__NAME"]; index++) {
30
+ for (let index = 0, section = "DATABASE__"+index; !!env[section+"__NAME"]; index++, section = "DATABASE__"+index) {
31
31
  try {
32
32
  let db_config = {
33
33
  client: 'mysql',