xernerx 2.1.5 → 2.1.8

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.
@@ -19,7 +19,8 @@ class ContextMenuCommand {
19
19
  channels: s.array(s.string).optional,
20
20
  guilds: s.array(s.string).optional,
21
21
  userPermissions: s.array(s.string).optional,
22
- clientPermissions: s.array(s.string).optional
22
+ clientPermissions: s.array(s.string).optional,
23
+ description: s.string.optional
23
24
  }).parse(options)
24
25
 
25
26
  this.data = new Discord.ContextMenuCommandBuilder()
@@ -45,6 +46,8 @@ class ContextMenuCommand {
45
46
  this.clientPermissions = options.clientPermissions || [];
46
47
 
47
48
  this.config = options.config;
49
+
50
+ this.description = options.description || undefined;
48
51
  }
49
52
 
50
53
  exec(interaction) {
@@ -34,7 +34,7 @@ class CommandValidation {
34
34
  return emit("missing admin permission", "Administrator")
35
35
  }
36
36
 
37
- if (command?.channel == "guild" && event?.channel?.type != "GUILD_TEXT") {
37
+ if (command?.channel == "guild" && event?.channel?.type != Discord.ChannelType.GuildText) {
38
38
  res = true
39
39
  return emit("not a guild channel");
40
40
  }
@@ -182,11 +182,21 @@ class Util {
182
182
  const msg = await message.channel.messages.fetch(message.client.messages[message.id]);
183
183
 
184
184
  message.util.send = async (e) => {
185
- return await msg.edit(e);
185
+ try {
186
+ return await msg.edit(e);
187
+ }
188
+ catch {
189
+ message.channel.send(e);
190
+ }
186
191
  }
187
192
 
188
193
  message.util.reply = async (e) => {
189
- return await msg.edit(e);
194
+ try {
195
+ return await msg.edit(e);
196
+ }
197
+ catch {
198
+ message.reply(e);
199
+ }
190
200
  }
191
201
 
192
202
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "2.1.5",
3
+ "version": "2.1.8",
4
4
  "description": "A bot framework for discord.js. [BETA]",
5
5
  "main": "main.js",
6
6
  "scripts": {