spacecommands 3.6.5 → 3.6.7
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.
|
@@ -4,12 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
const required_roles_1 = __importDefault(require("../models/required-roles"));
|
|
6
6
|
const commands_1 = __importDefault(require("../models/commands"));
|
|
7
|
-
const { ApplicationCommandOptionType } = require('discord.js');
|
|
8
7
|
module.exports = {
|
|
9
|
-
description: 'Specifies what role each command requires (Config
|
|
8
|
+
description: 'Specifies what role each command requires (Config v3)',
|
|
10
9
|
category: 'Configuration',
|
|
11
10
|
permissions: ['Administrator'],
|
|
12
11
|
aliases: ['requiredroles', 'requirerole', 'requireroles'],
|
|
12
|
+
cooldown: '2s',
|
|
13
|
+
slash: true,
|
|
13
14
|
minArgs: 2,
|
|
14
15
|
maxArgs: 2,
|
|
15
16
|
expectedArgs: '<command> <none-or-roleid>',
|
|
@@ -18,19 +19,17 @@ module.exports = {
|
|
|
18
19
|
name: 'command',
|
|
19
20
|
description: 'The command to set required roles for',
|
|
20
21
|
required: true,
|
|
21
|
-
type:
|
|
22
|
+
type: 3, // STRING
|
|
22
23
|
autocomplete: true,
|
|
23
24
|
},
|
|
24
25
|
{
|
|
25
26
|
name: 'none-or-roleid',
|
|
26
27
|
description: 'The role ID to require, or "none" to clear',
|
|
27
28
|
required: true,
|
|
28
|
-
type:
|
|
29
|
+
type: 3, // STRING
|
|
29
30
|
autocomplete: true,
|
|
30
31
|
}
|
|
31
32
|
],
|
|
32
|
-
cooldown: '2s',
|
|
33
|
-
slash: 'both',
|
|
34
33
|
autocomplete: async (interaction, instance) => {
|
|
35
34
|
const focusedOption = interaction.options.getFocused(true);
|
|
36
35
|
if (focusedOption.name === 'command') {
|
package/dist/models/cooldown.js
CHANGED
|
@@ -84,6 +84,21 @@ exports.default = {
|
|
|
84
84
|
cooldown: data.cooldown,
|
|
85
85
|
};
|
|
86
86
|
},
|
|
87
|
+
async deleteOne(filter) {
|
|
88
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
89
|
+
if (!client)
|
|
90
|
+
return { deletedCount: 0 };
|
|
91
|
+
let query = client.from(TABLE_NAME).delete();
|
|
92
|
+
if (filter._id) {
|
|
93
|
+
query = query.eq('id', filter._id);
|
|
94
|
+
}
|
|
95
|
+
const { error, count } = await query;
|
|
96
|
+
if (error) {
|
|
97
|
+
console.error('SpaceCommands > Error deleting cooldown:', error);
|
|
98
|
+
return { deletedCount: 0 };
|
|
99
|
+
}
|
|
100
|
+
return { deletedCount: count || 0 };
|
|
101
|
+
},
|
|
87
102
|
async deleteMany(filter) {
|
|
88
103
|
const client = (0, supabase_1.getSupabaseClient)();
|
|
89
104
|
if (!client)
|