xernerx 3.3.4 → 3.3.5

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.
@@ -1,6 +1,6 @@
1
- import { Message, ChannelType } from "discord.js";
2
- import { XernerxClient } from "../main.js";
3
- import { MessageArgOptions, MessageCommandOptions } from "../types/options.js";
1
+ import { Message, ChannelType } from 'discord.js';
2
+ import { XernerxClient } from '../main.js';
3
+ import { MessageArgOptions, MessageCommandOptions } from '../types/options.js';
4
4
  /**
5
5
  * @description - The command builder for message commands.
6
6
  * @param {String} id - The unique ID of the command.
@@ -1,5 +1,5 @@
1
- import { s } from "@sapphire/shapeshift";
2
- import { XernerxClient } from "../main.js";
1
+ import { s } from '@sapphire/shapeshift';
2
+ import { XernerxClient } from '../main.js';
3
3
  /**
4
4
  * @description - The command builder for message commands.
5
5
  * @param {String} id - The unique ID of the command.
@@ -49,18 +49,18 @@ export default class MessageCommandBuilder {
49
49
  this.description = options.description;
50
50
  this.info = options.info;
51
51
  this.category = options.category;
52
- this.prefix = options.prefix ? Array.isArray(options.prefix) ? options.prefix : [options.prefix] : [];
52
+ this.prefix = options.prefix ? (Array.isArray(options.prefix) ? options.prefix : [options.prefix]) : [];
53
53
  this.regex = options.regex;
54
54
  this.owner = options.owner || false;
55
55
  this.channelType = options.channelType;
56
- this.separator = options.separator || " ";
56
+ this.separator = options.separator || ' ';
57
57
  this.cooldown = options.cooldown || 0;
58
58
  this.ignoreOwner = options.ignoreOwner || false;
59
59
  this.channels = options.channels || [];
60
60
  this.guilds = options.guilds || [];
61
61
  this.userPermissions = options.userPermissions || [];
62
62
  this.clientPermissions = options.clientPermissions || [];
63
- this.args = options.args;
63
+ this.args = options.args || [];
64
64
  this.client = XernerxClient;
65
65
  this.conditions = this.conditions;
66
66
  this.exec = this.exec;
@@ -27,9 +27,9 @@ export async function messageArguments(message, command) {
27
27
  .filter((c) => c.type == 'flag')
28
28
  .map((flag) => {
29
29
  args = args;
30
- for (const flg of message.content.matchAll(flag.content)) {
31
- if (flag.content == flg) {
32
- message.content = message.content.replace(flag.content, '');
30
+ for (const flg of message.content.matchAll(flag.match)) {
31
+ if (flag.match == flg) {
32
+ message.content = message.content.replace(flag.match, '');
33
33
  args.flags[flag.name] = true;
34
34
  }
35
35
  }
@@ -29,4 +29,4 @@ export interface XernerxGuild extends Guild {
29
29
  }
30
30
  export interface XernerxMember extends GuildMember {
31
31
  }
32
- export type MessageCommandArgsTypes = 'flag' | 'string' | 'number' | 'channel' | 'user' | 'member' | 'boolean' | 'role';
32
+ export type MessageCommandArgsTypes = 'rest' | 'option' | 'flag' | 'string' | 'number' | 'channel' | 'user' | 'member' | 'boolean' | 'role';
@@ -89,13 +89,14 @@ export interface ContextCommandOptions {
89
89
  }
90
90
  export interface MessageArgOptions {
91
91
  type: MessageCommandArgsTypes;
92
- content?: string;
92
+ content?: Array<string>;
93
+ match?: string;
93
94
  name: string;
94
- prompt: {
95
+ prompt?: {
95
96
  reply: string;
96
97
  send: string;
97
98
  };
98
- default: string | Function;
99
+ default?: string | Function;
99
100
  }
100
101
  export interface SlashArgOptions {
101
102
  type: 'string' | 'number' | 'boolean' | 'user' | 'channel' | 'role' | 'mentionable' | 'integer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "type": "module",
5
5
  "description": "A bot framework for discord.js.",
6
6
  "main": "dist/main.js",