xernerx 3.5.2 → 3.6.0

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.
@@ -41,11 +41,6 @@ export default class ContextCommandBuilder {
41
41
  | undefined;
42
42
  defer:
43
43
  | {
44
- /**
45
- * @param {Interaction} interaction - The Discord interaction event data.
46
- * @description Make your custom command here.
47
- * TODO - update description
48
- */
49
44
  reply?: boolean | undefined;
50
45
  ephemeral?: boolean | undefined;
51
46
  fetch?: boolean | undefined;
@@ -19,6 +19,7 @@ export default class XernerxClient extends Client {
19
19
  util: ClientUtil;
20
20
  handlerOptions: HandlerOptions;
21
21
  events: Collection<string, EventBuilder>;
22
+ stats: object;
22
23
  extensions: Record<string, ExtensionBuilder>;
23
24
  inhibitors: Collection<string, InhibitorBuilder>;
24
25
  config: object;
@@ -13,6 +13,7 @@ const CommandHandler_js_1 = __importDefault(require('../handlers/CommandHandler.
13
13
  const EventHandler_js_1 = __importDefault(require('../handlers/EventHandler.js'));
14
14
  const InhibitorHandler_js_1 = __importDefault(require('../handlers/InhibitorHandler.js'));
15
15
  const Extensions_js_1 = __importDefault(require('../models/Extensions.js'));
16
+ const WebhookHandler_js_1 = __importDefault(require('../handlers/WebhookHandler.js'));
16
17
  // TODO - Add commandNotFound as an event to the client.
17
18
  /**
18
19
  * @description - The Client.
@@ -28,6 +29,7 @@ class XernerxClient extends discord_js_1.Client {
28
29
  util;
29
30
  handlerOptions;
30
31
  events;
32
+ stats;
31
33
  extensions;
32
34
  inhibitors;
33
35
  config;
@@ -85,7 +87,9 @@ class XernerxClient extends discord_js_1.Client {
85
87
  commandHandler: new CommandHandler_js_1.default(this),
86
88
  eventHandler: new EventHandler_js_1.default(this),
87
89
  inhibitorHandler: new InhibitorHandler_js_1.default(this),
90
+ webhookHandler: new WebhookHandler_js_1.default(this),
88
91
  };
92
+ this.stats = {};
89
93
  this.extensions = {};
90
94
  this.util = new ClientUtil_js_1.ClientUtil(this);
91
95
  this.handlerOptions = {};
@@ -0,0 +1,7 @@
1
+ import { XernerxClient } from '../main';
2
+ import { WebhookOptions } from '../types/options';
3
+ export default class WebhookHandler {
4
+ client: XernerxClient;
5
+ constructor(client: XernerxClient);
6
+ loadAllWebhooks(options: WebhookOptions): void;
7
+ }
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+ const dbl_sdk_1 = require('dbl-sdk');
9
+ const hasVoted_1 = __importDefault(require('dbl-sdk/dist/cjs/models/hasVoted'));
10
+ class WebhookHandler {
11
+ client;
12
+ constructor(client) {
13
+ this.client = client;
14
+ }
15
+ loadAllWebhooks(options) {
16
+ this.client.once('ready', (client) => {
17
+ const { options: config } = new dbl_sdk_1.DBL(client, options);
18
+ client.util.hasVoted = hasVoted_1.default;
19
+ client.handlerOptions.webhook = config;
20
+ });
21
+ }
22
+ }
23
+ exports.default = WebhookHandler;
@@ -12,6 +12,7 @@ const CommandArguments_js_1 = require('./CommandArguments.js');
12
12
  const CommandValidations_js_1 = __importDefault(require('../validators/CommandValidations.js'));
13
13
  const dumfunctions_1 = require('dumfunctions');
14
14
  const InhibitorValidations_js_1 = require('../validators/InhibitorValidations.js');
15
+ const XernerxUser_js_1 = __importDefault(require('./XernerxUser.js'));
15
16
  class MessageCommandEvents {
16
17
  client;
17
18
  constructor(client) {
@@ -22,7 +23,7 @@ class MessageCommandEvents {
22
23
  if (!message.author.bot) {
23
24
  let command = undefined,
24
25
  px = undefined;
25
- message.author.isOwner = this.client.util.isOwner(message.author.id);
26
+ message.author = await (0, XernerxUser_js_1.default)(message);
26
27
  message.util = new CommandUtil_js_1.MessageCommandUtil(this.client, message);
27
28
  const commands = this.client.commands.message;
28
29
  commands
@@ -78,7 +79,7 @@ class MessageCommandEvents {
78
79
  if (!message.author?.bot) {
79
80
  let command = undefined,
80
81
  px = undefined;
81
- if (message.author) message.author.isOwner = this.client.util.isOwner(message.author.id);
82
+ message.author = await (0, XernerxUser_js_1.default)(message);
82
83
  message.util = new CommandUtil_js_1.MessageCommandUtil(this.client, message);
83
84
  const commands = this.client.commands.message;
84
85
  commands
@@ -134,6 +135,7 @@ class MessageCommandEvents {
134
135
  if (this.client.cache.messages.has(message.id) && this.client.handlerOptions.message?.handleDeletes) {
135
136
  try {
136
137
  if (this.client.handlerOptions.message?.handleTyping) message.channel.sendTyping();
138
+ message.author = await (0, XernerxUser_js_1.default)(message);
137
139
  const msg = this.client.cache.messages.get(message.id);
138
140
  const response = await message.channel.messages.fetch(msg?.response);
139
141
  await response.delete();
@@ -153,7 +155,7 @@ class SlashCommandEvents {
153
155
  slashCreate() {
154
156
  this.client.on('interactionCreate', async (interaction) => {
155
157
  interaction.util = new CommandUtil_js_1.InteractionCommandUtil(this.client, interaction);
156
- interaction.user.isOwner = this.client.util.isOwner(interaction.user.id);
158
+ interaction.author = await (0, XernerxUser_js_1.default)(interaction);
157
159
  if (interaction.type === discord_js_1.InteractionType.ApplicationCommand) {
158
160
  if (this.client.commands.slash.has(interaction.commandName)) {
159
161
  let command = this.client.commands.slash.get(interaction.commandName);
@@ -204,7 +206,7 @@ class ContextCommandEvents {
204
206
  contextCreate() {
205
207
  this.client.on('interactionCreate', async (interaction) => {
206
208
  interaction.util = new CommandUtil_js_1.InteractionCommandUtil(this.client, interaction);
207
- interaction.user.isOwner = this.client.util.isOwner(interaction.user.id);
209
+ interaction.author = await (0, XernerxUser_js_1.default)(interaction);
208
210
  if (interaction.type === discord_js_1.InteractionType.ApplicationCommand) {
209
211
  if (this.client.commands.context.has(interaction.commandName)) {
210
212
  let command = this.client.commands.context.get(interaction.commandName);
@@ -0,0 +1,2 @@
1
+ import { XernerxUser } from '../types/types.js';
2
+ export default function XernerxUser(interaction: any): Promise<XernerxUser>;
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const dbl_sdk_1 = require('dbl-sdk');
4
+ async function XernerxUser(interaction) {
5
+ const user = interaction.user || interaction.author;
6
+ user.owner = interaction.client.util.isOwner(user.id);
7
+ user.voter = interaction.client.handlerOptions?.webhook?.topgg?.token
8
+ ? await (0, dbl_sdk_1.hasVoted)(user.id, interaction.client.user.id, interaction.client.handlerOptions.webhook.topgg.token, 'top.gg')
9
+ : false;
10
+ return user;
11
+ }
12
+ exports.default = XernerxUser;
@@ -1,21 +1,14 @@
1
1
  declare const _default: {
2
2
  name: string;
3
3
  version: string;
4
- type: string;
5
4
  description: string;
6
5
  main: string;
6
+ module: string;
7
7
  keywords: string[];
8
8
  author: string;
9
9
  license: string;
10
10
  homepage: string;
11
11
  packageManager: string;
12
- exports: {
13
- import: string;
14
- require: string;
15
- types: string;
16
- node: null;
17
- default: null;
18
- };
19
12
  scripts: {
20
13
  start: string;
21
14
  patch: string;
@@ -24,7 +17,10 @@ declare const _default: {
24
17
  site: string;
25
18
  commit: string;
26
19
  write: string;
20
+ format: string;
27
21
  build: string;
22
+ 'build:esm': string;
23
+ 'build:cjs': string;
28
24
  };
29
25
  repository: {
30
26
  type: string;
@@ -42,7 +38,6 @@ declare const _default: {
42
38
  };
43
39
  devDependencies: {
44
40
  prettier: string;
45
- tsup: string;
46
41
  typescript: string;
47
42
  };
48
43
  };
@@ -2,22 +2,15 @@
2
2
  Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.default = {
4
4
  name: 'xernerx',
5
- version: '3.5.1',
6
- type: 'module',
5
+ version: '3.5.2',
7
6
  description: 'A bot framework for discord.js.',
8
- main: 'dist/main.js',
7
+ main: 'dist/cjs/main.js',
8
+ module: 'dist/mjs/main.js',
9
9
  keywords: ['discord.js', 'discord', 'framework', 'mjs', 'esm', 'cjs', 'ts'],
10
10
  author: 'Dummi',
11
11
  license: 'MIT',
12
12
  homepage: 'https://xernerx.github.io/xernerx/home.html',
13
13
  packageManager: 'npm@8.5.5',
14
- exports: {
15
- import: './dist/main.js',
16
- require: './dist/main.cjs',
17
- types: './types',
18
- node: null,
19
- default: null,
20
- },
21
14
  scripts: {
22
15
  start: 'npm i && npm fund && npm audit fix --force && npm link && tsc -w',
23
16
  patch: 'npm run write && git add . && npm run commit && npm version patch && npm publish && git push',
@@ -25,8 +18,11 @@ exports.default = {
25
18
  major: 'npm run write && git add . && npm run commit && npm version major && npm publish && git push',
26
19
  site: 'git add docs && npm run commit && git push',
27
20
  commit: 'node ../.scripts/commit.js',
28
- write: 'npm run build && node ../.scripts/rewritePackage.js ',
29
- build: 'tsc && npx tsup src/main.ts && npx prettier --write src',
21
+ write: 'npm run build && npm run format && node ../.scripts/rewritePackage.js ',
22
+ format: 'npx prettier --write src dist',
23
+ build: 'npm run build:esm && npm run build:cjs',
24
+ 'build:esm': 'tsc',
25
+ 'build:cjs': 'tsc --module CommonJS --outDir dist/cjs',
30
26
  },
31
27
  repository: {
32
28
  type: 'git',
@@ -38,13 +34,12 @@ exports.default = {
38
34
  dependencies: {
39
35
  '@sapphire/shapeshift': '^3.8.1',
40
36
  'discord.js': '^14.7.1',
41
- dumfunctions: '^2.1.1',
42
- 'xernerx-extension-builder': '^0.0.5',
37
+ dumfunctions: '^2.1.2',
38
+ 'xernerx-extension-builder': '^0.0.8',
43
39
  zod: '^3.20.6',
44
40
  },
45
41
  devDependencies: {
46
42
  prettier: '^2.8.4',
47
- tsup: '^6.6.0',
48
43
  typescript: '^4.9.5',
49
44
  },
50
45
  };
@@ -5,6 +5,7 @@ import InhibitorHandler from '../handlers/InhibitorHandler.js';
5
5
  import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
6
6
  import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
7
7
  import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
8
+ import WebhookHandler from '../handlers/WebhookHandler.js';
8
9
  export interface ClientCommands {
9
10
  message: Collection<string, MessageCommandBuilder>;
10
11
  slash: Collection<string, SlashCommandBuilder>;
@@ -22,4 +23,5 @@ export interface ClientModules {
22
23
  commandHandler: CommandHandler;
23
24
  eventHandler: EventHandler;
24
25
  inhibitorHandler: InhibitorHandler;
26
+ webhookHandler: WebhookHandler;
25
27
  }
@@ -46,6 +46,7 @@ export interface HandlerOptions {
46
46
  context?: ContextCommandHandlerOptions;
47
47
  events?: EventHandlerOptions;
48
48
  inhibitors?: InhibitorHandlerOptions;
49
+ webhook?: WebhookOptions;
49
50
  }
50
51
  export interface ExtensionOptions {
51
52
  extensions: Array<XernerxExtensionBuilder>;
@@ -239,3 +240,15 @@ export interface InhibitorOptions {
239
240
  name: string;
240
241
  type: InhibitorType;
241
242
  }
243
+ export interface WebhookOptions {
244
+ topgg: {
245
+ token: string;
246
+ };
247
+ dbl: {
248
+ token: string;
249
+ };
250
+ config: {
251
+ emits: boolean;
252
+ logs: boolean;
253
+ };
254
+ }
@@ -19,7 +19,8 @@ export interface XernerxInteraction extends InteractionResponse {
19
19
  };
20
20
  }
21
21
  export interface XernerxUser extends User {
22
- isOwner: boolean;
22
+ owner: boolean;
23
+ voter?: boolean;
23
24
  }
24
25
  export interface XernerxRole extends Role {}
25
26
  export interface XernerxTextChannel extends TextChannel {}
@@ -9,6 +9,7 @@ interface Presence {
9
9
  }
10
10
  export declare class ClientUtil {
11
11
  client: XernerxClient;
12
+ [index: string]: Function | XernerxClient;
12
13
  constructor(client: XernerxClient);
13
14
  uptime(timestamp: number | null): string;
14
15
  getSubcommands(name: string): object[];
@@ -8,7 +8,7 @@ function getUser(from) {
8
8
  }
9
9
  function commandValidation(action, command, client, res = false) {
10
10
  let user = getUser(action);
11
- if ((command.ignoreOwner || client.settings.ignore?.owner) && client.util.isOwner(user.id)) return res;
11
+ if (client.settings.ignore?.owner && client.util.isOwner(user.id)) return res;
12
12
  else if (inCooldown(user, client, command, action)) return true;
13
13
  else if (command.owner && !client.util.isOwner(user.id)) {
14
14
  res = true;
@@ -41,11 +41,6 @@ export default class ContextCommandBuilder {
41
41
  | undefined;
42
42
  defer:
43
43
  | {
44
- /**
45
- * @param {Interaction} interaction - The Discord interaction event data.
46
- * @description Make your custom command here.
47
- * TODO - update description
48
- */
49
44
  reply?: boolean | undefined;
50
45
  ephemeral?: boolean | undefined;
51
46
  fetch?: boolean | undefined;
@@ -19,6 +19,7 @@ export default class XernerxClient extends Client {
19
19
  util: ClientUtil;
20
20
  handlerOptions: HandlerOptions;
21
21
  events: Collection<string, EventBuilder>;
22
+ stats: object;
22
23
  extensions: Record<string, ExtensionBuilder>;
23
24
  inhibitors: Collection<string, InhibitorBuilder>;
24
25
  config: object;
@@ -13,6 +13,7 @@ const CommandHandler_js_1 = __importDefault(require('../handlers/CommandHandler.
13
13
  const EventHandler_js_1 = __importDefault(require('../handlers/EventHandler.js'));
14
14
  const InhibitorHandler_js_1 = __importDefault(require('../handlers/InhibitorHandler.js'));
15
15
  const Extensions_js_1 = __importDefault(require('../models/Extensions.js'));
16
+ const WebhookHandler_js_1 = __importDefault(require('../handlers/WebhookHandler.js'));
16
17
  // TODO - Add commandNotFound as an event to the client.
17
18
  /**
18
19
  * @description - The Client.
@@ -28,6 +29,7 @@ class XernerxClient extends discord_js_1.Client {
28
29
  util;
29
30
  handlerOptions;
30
31
  events;
32
+ stats;
31
33
  extensions;
32
34
  inhibitors;
33
35
  config;
@@ -85,7 +87,9 @@ class XernerxClient extends discord_js_1.Client {
85
87
  commandHandler: new CommandHandler_js_1.default(this),
86
88
  eventHandler: new EventHandler_js_1.default(this),
87
89
  inhibitorHandler: new InhibitorHandler_js_1.default(this),
90
+ webhookHandler: new WebhookHandler_js_1.default(this),
88
91
  };
92
+ this.stats = {};
89
93
  this.extensions = {};
90
94
  this.util = new ClientUtil_js_1.ClientUtil(this);
91
95
  this.handlerOptions = {};
@@ -0,0 +1,7 @@
1
+ import { XernerxClient } from '../main';
2
+ import { WebhookOptions } from '../types/options';
3
+ export default class WebhookHandler {
4
+ client: XernerxClient;
5
+ constructor(client: XernerxClient);
6
+ loadAllWebhooks(options: WebhookOptions): void;
7
+ }
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+ const dbl_sdk_1 = require('dbl-sdk');
9
+ const hasVoted_1 = __importDefault(require('dbl-sdk/dist/cjs/models/hasVoted'));
10
+ class WebhookHandler {
11
+ client;
12
+ constructor(client) {
13
+ this.client = client;
14
+ }
15
+ loadAllWebhooks(options) {
16
+ this.client.once('ready', (client) => {
17
+ const { options: config } = new dbl_sdk_1.DBL(client, options);
18
+ client.util.hasVoted = hasVoted_1.default;
19
+ client.handlerOptions.webhook = config;
20
+ });
21
+ }
22
+ }
23
+ exports.default = WebhookHandler;
@@ -12,6 +12,7 @@ const CommandArguments_js_1 = require('./CommandArguments.js');
12
12
  const CommandValidations_js_1 = __importDefault(require('../validators/CommandValidations.js'));
13
13
  const dumfunctions_1 = require('dumfunctions');
14
14
  const InhibitorValidations_js_1 = require('../validators/InhibitorValidations.js');
15
+ const XernerxUser_js_1 = __importDefault(require('./XernerxUser.js'));
15
16
  class MessageCommandEvents {
16
17
  client;
17
18
  constructor(client) {
@@ -22,7 +23,7 @@ class MessageCommandEvents {
22
23
  if (!message.author.bot) {
23
24
  let command = undefined,
24
25
  px = undefined;
25
- message.author.isOwner = this.client.util.isOwner(message.author.id);
26
+ message.author = await (0, XernerxUser_js_1.default)(message);
26
27
  message.util = new CommandUtil_js_1.MessageCommandUtil(this.client, message);
27
28
  const commands = this.client.commands.message;
28
29
  commands
@@ -78,7 +79,7 @@ class MessageCommandEvents {
78
79
  if (!message.author?.bot) {
79
80
  let command = undefined,
80
81
  px = undefined;
81
- if (message.author) message.author.isOwner = this.client.util.isOwner(message.author.id);
82
+ message.author = await (0, XernerxUser_js_1.default)(message);
82
83
  message.util = new CommandUtil_js_1.MessageCommandUtil(this.client, message);
83
84
  const commands = this.client.commands.message;
84
85
  commands
@@ -134,6 +135,7 @@ class MessageCommandEvents {
134
135
  if (this.client.cache.messages.has(message.id) && this.client.handlerOptions.message?.handleDeletes) {
135
136
  try {
136
137
  if (this.client.handlerOptions.message?.handleTyping) message.channel.sendTyping();
138
+ message.author = await (0, XernerxUser_js_1.default)(message);
137
139
  const msg = this.client.cache.messages.get(message.id);
138
140
  const response = await message.channel.messages.fetch(msg?.response);
139
141
  await response.delete();
@@ -153,7 +155,7 @@ class SlashCommandEvents {
153
155
  slashCreate() {
154
156
  this.client.on('interactionCreate', async (interaction) => {
155
157
  interaction.util = new CommandUtil_js_1.InteractionCommandUtil(this.client, interaction);
156
- interaction.user.isOwner = this.client.util.isOwner(interaction.user.id);
158
+ interaction.author = await (0, XernerxUser_js_1.default)(interaction);
157
159
  if (interaction.type === discord_js_1.InteractionType.ApplicationCommand) {
158
160
  if (this.client.commands.slash.has(interaction.commandName)) {
159
161
  let command = this.client.commands.slash.get(interaction.commandName);
@@ -204,7 +206,7 @@ class ContextCommandEvents {
204
206
  contextCreate() {
205
207
  this.client.on('interactionCreate', async (interaction) => {
206
208
  interaction.util = new CommandUtil_js_1.InteractionCommandUtil(this.client, interaction);
207
- interaction.user.isOwner = this.client.util.isOwner(interaction.user.id);
209
+ interaction.author = await (0, XernerxUser_js_1.default)(interaction);
208
210
  if (interaction.type === discord_js_1.InteractionType.ApplicationCommand) {
209
211
  if (this.client.commands.context.has(interaction.commandName)) {
210
212
  let command = this.client.commands.context.get(interaction.commandName);
@@ -0,0 +1,2 @@
1
+ import { XernerxUser } from '../types/types.js';
2
+ export default function XernerxUser(interaction: any): Promise<XernerxUser>;
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const dbl_sdk_1 = require('dbl-sdk');
4
+ async function XernerxUser(interaction) {
5
+ const user = interaction.user || interaction.author;
6
+ user.owner = interaction.client.util.isOwner(user.id);
7
+ user.voter = interaction.client.handlerOptions?.webhook?.topgg?.token
8
+ ? await (0, dbl_sdk_1.hasVoted)(user.id, interaction.client.user.id, interaction.client.handlerOptions.webhook.topgg.token, 'top.gg')
9
+ : false;
10
+ return user;
11
+ }
12
+ exports.default = XernerxUser;
@@ -1,21 +1,14 @@
1
1
  declare const _default: {
2
2
  name: string;
3
3
  version: string;
4
- type: string;
5
4
  description: string;
6
5
  main: string;
6
+ module: string;
7
7
  keywords: string[];
8
8
  author: string;
9
9
  license: string;
10
10
  homepage: string;
11
11
  packageManager: string;
12
- exports: {
13
- import: string;
14
- require: string;
15
- types: string;
16
- node: null;
17
- default: null;
18
- };
19
12
  scripts: {
20
13
  start: string;
21
14
  patch: string;
@@ -24,7 +17,10 @@ declare const _default: {
24
17
  site: string;
25
18
  commit: string;
26
19
  write: string;
20
+ format: string;
27
21
  build: string;
22
+ 'build:esm': string;
23
+ 'build:cjs': string;
28
24
  };
29
25
  repository: {
30
26
  type: string;
@@ -42,7 +38,6 @@ declare const _default: {
42
38
  };
43
39
  devDependencies: {
44
40
  prettier: string;
45
- tsup: string;
46
41
  typescript: string;
47
42
  };
48
43
  };
@@ -2,22 +2,15 @@
2
2
  Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.default = {
4
4
  name: 'xernerx',
5
- version: '3.5.1',
6
- type: 'module',
5
+ version: '3.5.2',
7
6
  description: 'A bot framework for discord.js.',
8
- main: 'dist/main.js',
7
+ main: 'dist/cjs/main.js',
8
+ module: 'dist/mjs/main.js',
9
9
  keywords: ['discord.js', 'discord', 'framework', 'mjs', 'esm', 'cjs', 'ts'],
10
10
  author: 'Dummi',
11
11
  license: 'MIT',
12
12
  homepage: 'https://xernerx.github.io/xernerx/home.html',
13
13
  packageManager: 'npm@8.5.5',
14
- exports: {
15
- import: './dist/main.js',
16
- require: './dist/main.cjs',
17
- types: './types',
18
- node: null,
19
- default: null,
20
- },
21
14
  scripts: {
22
15
  start: 'npm i && npm fund && npm audit fix --force && npm link && tsc -w',
23
16
  patch: 'npm run write && git add . && npm run commit && npm version patch && npm publish && git push',
@@ -25,8 +18,11 @@ exports.default = {
25
18
  major: 'npm run write && git add . && npm run commit && npm version major && npm publish && git push',
26
19
  site: 'git add docs && npm run commit && git push',
27
20
  commit: 'node ../.scripts/commit.js',
28
- write: 'npm run build && node ../.scripts/rewritePackage.js ',
29
- build: 'tsc && npx tsup src/main.ts && npx prettier --write src',
21
+ write: 'npm run build && npm run format && node ../.scripts/rewritePackage.js ',
22
+ format: 'npx prettier --write src dist',
23
+ build: 'npm run build:esm && npm run build:cjs',
24
+ 'build:esm': 'tsc',
25
+ 'build:cjs': 'tsc --module CommonJS --outDir dist/cjs',
30
26
  },
31
27
  repository: {
32
28
  type: 'git',
@@ -38,13 +34,12 @@ exports.default = {
38
34
  dependencies: {
39
35
  '@sapphire/shapeshift': '^3.8.1',
40
36
  'discord.js': '^14.7.1',
41
- dumfunctions: '^2.1.1',
42
- 'xernerx-extension-builder': '^0.0.5',
37
+ dumfunctions: '^2.1.2',
38
+ 'xernerx-extension-builder': '^0.0.8',
43
39
  zod: '^3.20.6',
44
40
  },
45
41
  devDependencies: {
46
42
  prettier: '^2.8.4',
47
- tsup: '^6.6.0',
48
43
  typescript: '^4.9.5',
49
44
  },
50
45
  };
@@ -5,6 +5,7 @@ import InhibitorHandler from '../handlers/InhibitorHandler.js';
5
5
  import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
6
6
  import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
7
7
  import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
8
+ import WebhookHandler from '../handlers/WebhookHandler.js';
8
9
  export interface ClientCommands {
9
10
  message: Collection<string, MessageCommandBuilder>;
10
11
  slash: Collection<string, SlashCommandBuilder>;
@@ -22,4 +23,5 @@ export interface ClientModules {
22
23
  commandHandler: CommandHandler;
23
24
  eventHandler: EventHandler;
24
25
  inhibitorHandler: InhibitorHandler;
26
+ webhookHandler: WebhookHandler;
25
27
  }
@@ -46,6 +46,7 @@ export interface HandlerOptions {
46
46
  context?: ContextCommandHandlerOptions;
47
47
  events?: EventHandlerOptions;
48
48
  inhibitors?: InhibitorHandlerOptions;
49
+ webhook?: WebhookOptions;
49
50
  }
50
51
  export interface ExtensionOptions {
51
52
  extensions: Array<XernerxExtensionBuilder>;
@@ -239,3 +240,15 @@ export interface InhibitorOptions {
239
240
  name: string;
240
241
  type: InhibitorType;
241
242
  }
243
+ export interface WebhookOptions {
244
+ topgg: {
245
+ token: string;
246
+ };
247
+ dbl: {
248
+ token: string;
249
+ };
250
+ config: {
251
+ emits: boolean;
252
+ logs: boolean;
253
+ };
254
+ }
@@ -19,7 +19,8 @@ export interface XernerxInteraction extends InteractionResponse {
19
19
  };
20
20
  }
21
21
  export interface XernerxUser extends User {
22
- isOwner: boolean;
22
+ owner: boolean;
23
+ voter?: boolean;
23
24
  }
24
25
  export interface XernerxRole extends Role {}
25
26
  export interface XernerxTextChannel extends TextChannel {}
@@ -9,6 +9,7 @@ interface Presence {
9
9
  }
10
10
  export declare class ClientUtil {
11
11
  client: XernerxClient;
12
+ [index: string]: Function | XernerxClient;
12
13
  constructor(client: XernerxClient);
13
14
  uptime(timestamp: number | null): string;
14
15
  getSubcommands(name: string): object[];
@@ -8,7 +8,7 @@ function getUser(from) {
8
8
  }
9
9
  function commandValidation(action, command, client, res = false) {
10
10
  let user = getUser(action);
11
- if ((command.ignoreOwner || client.settings.ignore?.owner) && client.util.isOwner(user.id)) return res;
11
+ if (client.settings.ignore?.owner && client.util.isOwner(user.id)) return res;
12
12
  else if (inCooldown(user, client, command, action)) return true;
13
13
  else if (command.owner && !client.util.isOwner(user.id)) {
14
14
  res = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "3.5.2",
3
+ "version": "3.6.0",
4
4
  "description": "A bot framework for discord.js.",
5
5
  "main": "dist/cjs/main.js",
6
6
  "module": "dist/mjs/main.js",
@@ -26,7 +26,7 @@
26
26
  "commit": "node ../.scripts/commit.js",
27
27
  "write": "npm run build && npm run format && node ../.scripts/rewritePackage.js ",
28
28
  "format": "npx prettier --write src dist",
29
- "build": "npm run build:esm && npm run build:cjs",
29
+ "build": "npm run build:esm && npm run build:cjs && npm run format",
30
30
  "build:esm": "tsc",
31
31
  "build:cjs": "tsc --module CommonJS --outDir dist/cjs"
32
32
  },
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@sapphire/shapeshift": "^3.8.1",
42
+ "dbl-sdk": "^1.2.0",
42
43
  "discord.js": "^14.7.1",
43
44
  "dumfunctions": "^2.1.2",
44
45
  "xernerx-extension-builder": "^0.0.8",