spacecommands 1.0.0 → 3.0.1
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/README.md +55 -2
- package/dist/index.js +14 -43
- package/dist/models/channel-commands.js +90 -46
- package/dist/models/cooldown.js +99 -48
- package/dist/models/disabled-commands.js +86 -42
- package/dist/models/languages.js +62 -43
- package/dist/models/prefixes.js +78 -43
- package/dist/models/required-roles.js +90 -46
- package/dist/mongo.js +1 -0
- package/dist/supabase.js +17 -0
- package/package.json +4 -4
- package/typings.d.ts +4 -10
package/README.md
CHANGED
|
@@ -55,13 +55,64 @@ client.on('ready', () => {
|
|
|
55
55
|
featuresDir: path.join(__dirname, 'features'),
|
|
56
56
|
testServers: ['YOUR_TEST_SERVER_ID'],
|
|
57
57
|
botOwners: ['YOUR_USER_ID'],
|
|
58
|
-
|
|
58
|
+
// Database (optional - Supabase recommended)
|
|
59
|
+
supabaseUrl: process.env.SUPABASE_URL,
|
|
60
|
+
supabaseKey: process.env.SUPABASE_KEY,
|
|
59
61
|
});
|
|
60
62
|
});
|
|
61
63
|
|
|
62
64
|
client.login(process.env.BOT_TOKEN);
|
|
63
65
|
```
|
|
64
66
|
|
|
67
|
+
## Supabase Setup (Recommended)
|
|
68
|
+
|
|
69
|
+
SpaceCommands now uses Supabase for data persistence instead of MongoDB. Here's how to set it up:
|
|
70
|
+
|
|
71
|
+
### 1. Create a Supabase Project
|
|
72
|
+
|
|
73
|
+
1. Go to [supabase.com](https://supabase.com) and create a free account
|
|
74
|
+
2. Create a new project
|
|
75
|
+
3. Copy your project URL and anon/public key
|
|
76
|
+
|
|
77
|
+
### 2. Set Up the Database
|
|
78
|
+
|
|
79
|
+
1. In your Supabase dashboard, go to the SQL Editor
|
|
80
|
+
2. Copy the contents of `supabase-schema.sql` from this package
|
|
81
|
+
3. Run the SQL to create all required tables
|
|
82
|
+
|
|
83
|
+
Or download the schema:
|
|
84
|
+
```bash
|
|
85
|
+
curl -o supabase-schema.sql https://raw.githubusercontent.com/VicToMeyeZR/SpaceCommands/main/supabase-schema.sql
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 3. Configure Your Bot
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
new SpaceCommands(client, {
|
|
92
|
+
commandsDir: path.join(__dirname, 'commands'),
|
|
93
|
+
supabaseUrl: process.env.SUPABASE_URL, // Your Supabase project URL
|
|
94
|
+
supabaseKey: process.env.SUPABASE_ANON_KEY, // Your Supabase anon/public key
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 4. Environment Variables
|
|
99
|
+
|
|
100
|
+
Create a `.env` file:
|
|
101
|
+
```env
|
|
102
|
+
DISCORD_TOKEN=your_bot_token_here
|
|
103
|
+
SUPABASE_URL=https://your-project.supabase.co
|
|
104
|
+
SUPABASE_ANON_KEY=your_anon_key_here
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Benefits of Supabase
|
|
108
|
+
|
|
109
|
+
- ✅ **Free tier** with generous limits
|
|
110
|
+
- ✅ **Real-time subscriptions** (optional)
|
|
111
|
+
- ✅ **Built-in authentication** (if needed)
|
|
112
|
+
- ✅ **Auto-generated APIs**
|
|
113
|
+
- ✅ **Better performance** than MongoDB for most use cases
|
|
114
|
+
- ✅ **PostgreSQL** under the hood
|
|
115
|
+
|
|
65
116
|
## Creating Commands
|
|
66
117
|
|
|
67
118
|
### Slash Command Example
|
|
@@ -100,7 +151,9 @@ module.exports = {
|
|
|
100
151
|
|--------|------|-------------|---------|
|
|
101
152
|
| `commandsDir` | string | Absolute path to commands directory | Required |
|
|
102
153
|
| `featuresDir` | string | Absolute path to features directory | Optional |
|
|
103
|
-
| `
|
|
154
|
+
| `supabaseUrl` | string | Supabase project URL | Optional |
|
|
155
|
+
| `supabaseKey` | string | Supabase anon/public key | Optional |
|
|
156
|
+
| `mongoUri` | string | MongoDB URI (deprecated, use Supabase) | Optional |
|
|
104
157
|
| `testServers` | string[] | Guild IDs for testing commands | [] |
|
|
105
158
|
| `botOwners` | string[] | User IDs of bot owners | [] |
|
|
106
159
|
| `defaultLanguage` | string | Default language for messages | 'english' |
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
const events_1 = require("events");
|
|
40
7
|
const FeatureHandler_1 = __importDefault(require("./FeatureHandler"));
|
|
41
|
-
const
|
|
8
|
+
const supabase_1 = __importDefault(require("./supabase"));
|
|
42
9
|
const prefixes_1 = __importDefault(require("./models/prefixes"));
|
|
43
10
|
const message_handler_1 = __importDefault(require("./message-handler"));
|
|
44
11
|
const SlashCommands_1 = __importDefault(require("./SlashCommands"));
|
|
@@ -55,7 +22,7 @@ class SpaceCommands extends events_1.EventEmitter {
|
|
|
55
22
|
_defaultPrefix = '!';
|
|
56
23
|
_commandsDir = 'commands';
|
|
57
24
|
_featuresDir = '';
|
|
58
|
-
|
|
25
|
+
_supabaseClient = null;
|
|
59
26
|
_displayName = '';
|
|
60
27
|
_prefixes = {};
|
|
61
28
|
_categories = new Map(); // <Category Name, Emoji Icon>
|
|
@@ -89,10 +56,11 @@ class SpaceCommands extends events_1.EventEmitter {
|
|
|
89
56
|
if (!client) {
|
|
90
57
|
throw new Error('No Discord JS Client provided as first argument!');
|
|
91
58
|
}
|
|
92
|
-
let { commandsDir = '', commandDir = '', featuresDir = '', featureDir = '', componentsDir, modalsDir, contextMenusDir, messagesPath,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.
|
|
59
|
+
let { commandsDir = '', commandDir = '', featuresDir = '', featureDir = '', componentsDir, modalsDir, contextMenusDir, messagesPath, supabaseUrl, supabaseKey, showWarns = true, delErrMsgCooldown = -1, defaultLanguage = 'english', ignoreBots = true, dbOptions, testServers, botOwners, disabledDefaultCommands = [], typeScript = false, ephemeral = true, debug = false, } = options || {};
|
|
60
|
+
// Support for Supabase (recommended) or MongoDB (deprecated)
|
|
61
|
+
if (supabaseUrl && supabaseKey) {
|
|
62
|
+
this._supabaseClient = await (0, supabase_1.default)(supabaseUrl, supabaseKey, this);
|
|
63
|
+
// Load prefixes from Supabase
|
|
96
64
|
const results = await prefixes_1.default.find({});
|
|
97
65
|
for (const result of results) {
|
|
98
66
|
const { _id, prefix } = result;
|
|
@@ -101,7 +69,7 @@ class SpaceCommands extends events_1.EventEmitter {
|
|
|
101
69
|
}
|
|
102
70
|
else {
|
|
103
71
|
if (showWarns) {
|
|
104
|
-
console.warn('SpaceCommands > No
|
|
72
|
+
console.warn('SpaceCommands > No database connection provided. Some features might not work! Please provide supabaseUrl and supabaseKey.');
|
|
105
73
|
}
|
|
106
74
|
this.emit(Events_1.default.DATABASE_CONNECTED, null, '');
|
|
107
75
|
}
|
|
@@ -260,12 +228,15 @@ class SpaceCommands extends events_1.EventEmitter {
|
|
|
260
228
|
get commandHandler() {
|
|
261
229
|
return this._commandHandler;
|
|
262
230
|
}
|
|
231
|
+
get supabaseClient() {
|
|
232
|
+
return this._supabaseClient;
|
|
233
|
+
}
|
|
263
234
|
get mongoConnection() {
|
|
264
|
-
|
|
235
|
+
// Deprecated: For backwards compatibility only
|
|
236
|
+
return this._supabaseClient;
|
|
265
237
|
}
|
|
266
238
|
isDBConnected() {
|
|
267
|
-
|
|
268
|
-
return !!(connection && connection.readyState === 1);
|
|
239
|
+
return !!this._supabaseClient;
|
|
269
240
|
}
|
|
270
241
|
setTagPeople(tagPeople) {
|
|
271
242
|
this._tagPeople = tagPeople;
|
|
@@ -1,49 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const supabase_1 = require("../supabase");
|
|
5
|
+
const TABLE_NAME = 'spacecommands_channel_commands';
|
|
6
|
+
exports.default = {
|
|
7
|
+
async find(filter = {}) {
|
|
8
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
9
|
+
if (!client)
|
|
10
|
+
return [];
|
|
11
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
12
|
+
if (filter.guildId) {
|
|
13
|
+
query = query.eq('guild_id', filter.guildId);
|
|
14
|
+
}
|
|
15
|
+
if (filter.command) {
|
|
16
|
+
query = query.eq('command', filter.command);
|
|
17
|
+
}
|
|
18
|
+
const { data, error } = await query;
|
|
19
|
+
if (error) {
|
|
20
|
+
console.error('SpaceCommands > Error fetching channel commands:', error);
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return (data || []).map((row) => ({
|
|
24
|
+
guildId: row.guild_id,
|
|
25
|
+
command: row.command,
|
|
26
|
+
channels: row.channels,
|
|
27
|
+
}));
|
|
28
|
+
},
|
|
29
|
+
async findOne(filter) {
|
|
30
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
31
|
+
if (!client)
|
|
32
|
+
return null;
|
|
33
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
34
|
+
if (filter.guildId) {
|
|
35
|
+
query = query.eq('guild_id', filter.guildId);
|
|
36
|
+
}
|
|
37
|
+
if (filter.command) {
|
|
38
|
+
query = query.eq('command', filter.command);
|
|
39
|
+
}
|
|
40
|
+
const { data, error } = await query.single();
|
|
41
|
+
if (error) {
|
|
42
|
+
if (error.code === 'PGRST116')
|
|
43
|
+
return null;
|
|
44
|
+
console.error('SpaceCommands > Error finding channel command:', error);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
guildId: data.guild_id,
|
|
49
|
+
command: data.command,
|
|
50
|
+
channels: data.channels,
|
|
24
51
|
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
const mongoose_1 = __importStar(require("mongoose"));
|
|
36
|
-
const reqString = {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
};
|
|
40
|
-
const schema = new mongoose_1.Schema({
|
|
41
|
-
guildId: reqString,
|
|
42
|
-
command: reqString,
|
|
43
|
-
channels: {
|
|
44
|
-
type: [String],
|
|
45
|
-
required: true,
|
|
46
52
|
},
|
|
47
|
-
})
|
|
48
|
-
const
|
|
49
|
-
|
|
53
|
+
async findOneAndUpdate(filter, update, options = {}) {
|
|
54
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
55
|
+
if (!client)
|
|
56
|
+
return null;
|
|
57
|
+
const guildId = filter.guildId;
|
|
58
|
+
const command = filter.command || update.command || update.$set?.command;
|
|
59
|
+
const channels = update.channels || update.$set?.channels;
|
|
60
|
+
const { data, error } = await client
|
|
61
|
+
.from(TABLE_NAME)
|
|
62
|
+
.upsert({ guild_id: guildId, command, channels }, { onConflict: 'guild_id,command' })
|
|
63
|
+
.select()
|
|
64
|
+
.single();
|
|
65
|
+
if (error) {
|
|
66
|
+
console.error('SpaceCommands > Error upserting channel command:', error);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
guildId: data.guild_id,
|
|
71
|
+
command: data.command,
|
|
72
|
+
channels: data.channels,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
async deleteOne(filter) {
|
|
76
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
77
|
+
if (!client)
|
|
78
|
+
return { deletedCount: 0 };
|
|
79
|
+
let query = client.from(TABLE_NAME).delete();
|
|
80
|
+
if (filter.guildId) {
|
|
81
|
+
query = query.eq('guild_id', filter.guildId);
|
|
82
|
+
}
|
|
83
|
+
if (filter.command) {
|
|
84
|
+
query = query.eq('command', filter.command);
|
|
85
|
+
}
|
|
86
|
+
const { error } = await query;
|
|
87
|
+
if (error) {
|
|
88
|
+
console.error('SpaceCommands > Error deleting channel command:', error);
|
|
89
|
+
return { deletedCount: 0 };
|
|
90
|
+
}
|
|
91
|
+
return { deletedCount: 1 };
|
|
92
|
+
},
|
|
93
|
+
};
|
package/dist/models/cooldown.js
CHANGED
|
@@ -1,51 +1,102 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const supabase_1 = require("../supabase");
|
|
5
|
+
const TABLE_NAME = 'spacecommands_cooldowns';
|
|
6
|
+
exports.default = {
|
|
7
|
+
async find(filter = {}) {
|
|
8
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
9
|
+
if (!client)
|
|
10
|
+
return [];
|
|
11
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
12
|
+
// Apply filters
|
|
13
|
+
if (filter._id) {
|
|
14
|
+
query = query.eq('id', filter._id);
|
|
15
|
+
}
|
|
16
|
+
if (filter.name) {
|
|
17
|
+
query = query.eq('name', filter.name);
|
|
18
|
+
}
|
|
19
|
+
if (filter.type) {
|
|
20
|
+
query = query.eq('type', filter.type);
|
|
21
|
+
}
|
|
22
|
+
const { data, error } = await query;
|
|
23
|
+
if (error) {
|
|
24
|
+
console.error('SpaceCommands > Error fetching cooldowns:', error);
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
return (data || []).map((row) => ({
|
|
28
|
+
_id: row.id,
|
|
29
|
+
name: row.name,
|
|
30
|
+
type: row.type,
|
|
31
|
+
cooldown: row.cooldown,
|
|
32
|
+
}));
|
|
33
|
+
},
|
|
34
|
+
async findOne(filter) {
|
|
35
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
36
|
+
if (!client)
|
|
37
|
+
return null;
|
|
38
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
39
|
+
if (filter._id) {
|
|
40
|
+
query = query.eq('id', filter._id);
|
|
41
|
+
}
|
|
42
|
+
const { data, error } = await query.single();
|
|
43
|
+
if (error) {
|
|
44
|
+
if (error.code === 'PGRST116')
|
|
45
|
+
return null;
|
|
46
|
+
console.error('SpaceCommands > Error finding cooldown:', error);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
_id: data.id,
|
|
51
|
+
name: data.name,
|
|
52
|
+
type: data.type,
|
|
53
|
+
cooldown: data.cooldown,
|
|
24
54
|
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
const mongoose_1 = __importStar(require("mongoose"));
|
|
36
|
-
const reqString = {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
};
|
|
40
|
-
const schema = new mongoose_1.Schema({
|
|
41
|
-
// Command-GuildID or Command-GuildID-UserID
|
|
42
|
-
_id: reqString,
|
|
43
|
-
name: reqString,
|
|
44
|
-
type: reqString,
|
|
45
|
-
cooldown: {
|
|
46
|
-
type: Number,
|
|
47
|
-
required: true,
|
|
48
55
|
},
|
|
49
|
-
})
|
|
50
|
-
const
|
|
51
|
-
|
|
56
|
+
async findOneAndUpdate(filter, update, options = {}) {
|
|
57
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
58
|
+
if (!client)
|
|
59
|
+
return null;
|
|
60
|
+
const id = filter._id;
|
|
61
|
+
const updateData = {};
|
|
62
|
+
if (update.cooldown !== undefined)
|
|
63
|
+
updateData.cooldown = update.cooldown;
|
|
64
|
+
if (update.name !== undefined)
|
|
65
|
+
updateData.name = update.name;
|
|
66
|
+
if (update.type !== undefined)
|
|
67
|
+
updateData.type = update.type;
|
|
68
|
+
if (update.$set) {
|
|
69
|
+
Object.assign(updateData, update.$set);
|
|
70
|
+
}
|
|
71
|
+
const { data, error } = await client
|
|
72
|
+
.from(TABLE_NAME)
|
|
73
|
+
.upsert({ id, ...updateData }, { onConflict: 'id' })
|
|
74
|
+
.select()
|
|
75
|
+
.single();
|
|
76
|
+
if (error) {
|
|
77
|
+
console.error('SpaceCommands > Error upserting cooldown:', error);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
_id: data.id,
|
|
82
|
+
name: data.name,
|
|
83
|
+
type: data.type,
|
|
84
|
+
cooldown: data.cooldown,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
async deleteMany(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.cooldown?.$lte !== undefined) {
|
|
93
|
+
query = query.lte('cooldown', filter.cooldown.$lte);
|
|
94
|
+
}
|
|
95
|
+
const { error, count } = await query;
|
|
96
|
+
if (error) {
|
|
97
|
+
console.error('SpaceCommands > Error deleting cooldowns:', error);
|
|
98
|
+
return { deletedCount: 0 };
|
|
99
|
+
}
|
|
100
|
+
return { deletedCount: count || 0 };
|
|
101
|
+
},
|
|
102
|
+
};
|
|
@@ -1,45 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const supabase_1 = require("../supabase");
|
|
5
|
+
const TABLE_NAME = 'spacecommands_disabled_commands';
|
|
6
|
+
exports.default = {
|
|
7
|
+
async find(filter = {}) {
|
|
8
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
9
|
+
if (!client)
|
|
10
|
+
return [];
|
|
11
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
12
|
+
if (filter.guildId) {
|
|
13
|
+
query = query.eq('guild_id', filter.guildId);
|
|
14
|
+
}
|
|
15
|
+
if (filter.command) {
|
|
16
|
+
query = query.eq('command', filter.command);
|
|
17
|
+
}
|
|
18
|
+
const { data, error } = await query;
|
|
19
|
+
if (error) {
|
|
20
|
+
console.error('SpaceCommands > Error fetching disabled commands:', error);
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return (data || []).map((row) => ({
|
|
24
|
+
guildId: row.guild_id,
|
|
25
|
+
command: row.command,
|
|
26
|
+
}));
|
|
27
|
+
},
|
|
28
|
+
async findOne(filter) {
|
|
29
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
30
|
+
if (!client)
|
|
31
|
+
return null;
|
|
32
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
33
|
+
if (filter.guildId) {
|
|
34
|
+
query = query.eq('guild_id', filter.guildId);
|
|
35
|
+
}
|
|
36
|
+
if (filter.command) {
|
|
37
|
+
query = query.eq('command', filter.command);
|
|
38
|
+
}
|
|
39
|
+
const { data, error } = await query.single();
|
|
40
|
+
if (error) {
|
|
41
|
+
if (error.code === 'PGRST116')
|
|
42
|
+
return null;
|
|
43
|
+
console.error('SpaceCommands > Error finding disabled command:', error);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
guildId: data.guild_id,
|
|
48
|
+
command: data.command,
|
|
24
49
|
};
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
},
|
|
51
|
+
async findOneAndUpdate(filter, update, options = {}) {
|
|
52
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
53
|
+
if (!client)
|
|
54
|
+
return null;
|
|
55
|
+
const guildId = filter.guildId;
|
|
56
|
+
const command = filter.command || update.command || update.$set?.command;
|
|
57
|
+
const { data, error } = await client
|
|
58
|
+
.from(TABLE_NAME)
|
|
59
|
+
.upsert({ guild_id: guildId, command }, { onConflict: 'guild_id,command' })
|
|
60
|
+
.select()
|
|
61
|
+
.single();
|
|
62
|
+
if (error) {
|
|
63
|
+
console.error('SpaceCommands > Error upserting disabled command:', error);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
guildId: data.guild_id,
|
|
68
|
+
command: data.command,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
async deleteOne(filter) {
|
|
72
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
73
|
+
if (!client)
|
|
74
|
+
return { deletedCount: 0 };
|
|
75
|
+
let query = client.from(TABLE_NAME).delete();
|
|
76
|
+
if (filter.guildId) {
|
|
77
|
+
query = query.eq('guild_id', filter.guildId);
|
|
78
|
+
}
|
|
79
|
+
if (filter.command) {
|
|
80
|
+
query = query.eq('command', filter.command);
|
|
81
|
+
}
|
|
82
|
+
const { error } = await query;
|
|
83
|
+
if (error) {
|
|
84
|
+
console.error('SpaceCommands > Error deleting disabled command:', error);
|
|
85
|
+
return { deletedCount: 0 };
|
|
86
|
+
}
|
|
87
|
+
return { deletedCount: 1 };
|
|
88
|
+
},
|
|
39
89
|
};
|
|
40
|
-
const schema = new mongoose_1.Schema({
|
|
41
|
-
guildId: reqString,
|
|
42
|
-
command: reqString,
|
|
43
|
-
});
|
|
44
|
-
const name = 'spacecommands-disabled-commands';
|
|
45
|
-
module.exports = mongoose_1.default.models[name] || mongoose_1.default.model(name, schema, name);
|
package/dist/models/languages.js
CHANGED
|
@@ -1,46 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const supabase_1 = require("../supabase");
|
|
5
|
+
const TABLE_NAME = 'spacecommands_languages';
|
|
6
|
+
exports.default = {
|
|
7
|
+
async find(filter = {}) {
|
|
8
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
9
|
+
if (!client)
|
|
10
|
+
return [];
|
|
11
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
12
|
+
if (filter._id) {
|
|
13
|
+
query = query.eq('guild_id', filter._id);
|
|
14
|
+
}
|
|
15
|
+
const { data, error } = await query;
|
|
16
|
+
if (error) {
|
|
17
|
+
console.error('SpaceCommands > Error fetching languages:', error);
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
return (data || []).map((row) => ({
|
|
21
|
+
_id: row.guild_id,
|
|
22
|
+
language: row.language,
|
|
23
|
+
}));
|
|
24
|
+
},
|
|
25
|
+
async findOne(filter) {
|
|
26
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
27
|
+
if (!client)
|
|
28
|
+
return null;
|
|
29
|
+
const { data, error } = await client
|
|
30
|
+
.from(TABLE_NAME)
|
|
31
|
+
.select('*')
|
|
32
|
+
.eq('guild_id', filter._id)
|
|
33
|
+
.single();
|
|
34
|
+
if (error) {
|
|
35
|
+
if (error.code === 'PGRST116')
|
|
36
|
+
return null;
|
|
37
|
+
console.error('SpaceCommands > Error finding language:', error);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
_id: data.guild_id,
|
|
42
|
+
language: data.language,
|
|
24
43
|
};
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
},
|
|
45
|
+
async findOneAndUpdate(filter, update, options = {}) {
|
|
46
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
47
|
+
if (!client)
|
|
48
|
+
return null;
|
|
49
|
+
const guildId = filter._id;
|
|
50
|
+
const language = update.language || update.$set?.language;
|
|
51
|
+
const { data, error } = await client
|
|
52
|
+
.from(TABLE_NAME)
|
|
53
|
+
.upsert({ guild_id: guildId, language }, { onConflict: 'guild_id' })
|
|
54
|
+
.select()
|
|
55
|
+
.single();
|
|
56
|
+
if (error) {
|
|
57
|
+
console.error('SpaceCommands > Error upserting language:', error);
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
_id: data.guild_id,
|
|
62
|
+
language: data.language,
|
|
63
|
+
};
|
|
64
|
+
},
|
|
39
65
|
};
|
|
40
|
-
const schema = new mongoose_1.Schema({
|
|
41
|
-
// GuildID
|
|
42
|
-
_id: reqString,
|
|
43
|
-
language: reqString,
|
|
44
|
-
});
|
|
45
|
-
const name = 'spacecommands-languages';
|
|
46
|
-
module.exports = mongoose_1.default.models[name] || mongoose_1.default.model(name, schema, name);
|
package/dist/models/prefixes.js
CHANGED
|
@@ -1,46 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const supabase_1 = require("../supabase");
|
|
5
|
+
const TABLE_NAME = 'spacecommands_prefixes';
|
|
6
|
+
exports.default = {
|
|
7
|
+
async find(filter = {}) {
|
|
8
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
9
|
+
if (!client)
|
|
10
|
+
return [];
|
|
11
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
12
|
+
// Apply filters if provided
|
|
13
|
+
if (filter._id) {
|
|
14
|
+
query = query.eq('guild_id', filter._id);
|
|
15
|
+
}
|
|
16
|
+
const { data, error } = await query;
|
|
17
|
+
if (error) {
|
|
18
|
+
console.error('SpaceCommands > Error fetching prefixes:', error);
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
// Transform to match Mongoose format
|
|
22
|
+
return (data || []).map((row) => ({
|
|
23
|
+
_id: row.guild_id,
|
|
24
|
+
prefix: row.prefix,
|
|
25
|
+
}));
|
|
26
|
+
},
|
|
27
|
+
async findOne(filter) {
|
|
28
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
29
|
+
if (!client)
|
|
30
|
+
return null;
|
|
31
|
+
const { data, error } = await client
|
|
32
|
+
.from(TABLE_NAME)
|
|
33
|
+
.select('*')
|
|
34
|
+
.eq('guild_id', filter._id)
|
|
35
|
+
.single();
|
|
36
|
+
if (error) {
|
|
37
|
+
if (error.code === 'PGRST116')
|
|
38
|
+
return null; // No rows found
|
|
39
|
+
console.error('SpaceCommands > Error finding prefix:', error);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
_id: data.guild_id,
|
|
44
|
+
prefix: data.prefix,
|
|
24
45
|
};
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
},
|
|
47
|
+
async findOneAndUpdate(filter, update, options = {}) {
|
|
48
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
49
|
+
if (!client)
|
|
50
|
+
return null;
|
|
51
|
+
const guildId = filter._id;
|
|
52
|
+
const prefix = update.prefix || update.$set?.prefix;
|
|
53
|
+
const { data, error } = await client
|
|
54
|
+
.from(TABLE_NAME)
|
|
55
|
+
.upsert({ guild_id: guildId, prefix }, { onConflict: 'guild_id' })
|
|
56
|
+
.select()
|
|
57
|
+
.single();
|
|
58
|
+
if (error) {
|
|
59
|
+
console.error('SpaceCommands > Error upserting prefix:', error);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
_id: data.guild_id,
|
|
64
|
+
prefix: data.prefix,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
async deleteOne(filter) {
|
|
68
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
69
|
+
if (!client)
|
|
70
|
+
return { deletedCount: 0 };
|
|
71
|
+
const { error } = await client
|
|
72
|
+
.from(TABLE_NAME)
|
|
73
|
+
.delete()
|
|
74
|
+
.eq('guild_id', filter._id);
|
|
75
|
+
if (error) {
|
|
76
|
+
console.error('SpaceCommands > Error deleting prefix:', error);
|
|
77
|
+
return { deletedCount: 0 };
|
|
78
|
+
}
|
|
79
|
+
return { deletedCount: 1 };
|
|
80
|
+
},
|
|
39
81
|
};
|
|
40
|
-
const schema = new mongoose_1.Schema({
|
|
41
|
-
// Guild ID
|
|
42
|
-
_id: reqString,
|
|
43
|
-
prefix: reqString,
|
|
44
|
-
});
|
|
45
|
-
const name = 'spacecommands-prefixes';
|
|
46
|
-
module.exports = mongoose_1.default.models[name] || mongoose_1.default.model(name, schema, name);
|
|
@@ -1,49 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
const supabase_1 = require("../supabase");
|
|
5
|
+
const TABLE_NAME = 'spacecommands_required_roles';
|
|
6
|
+
exports.default = {
|
|
7
|
+
async find(filter = {}) {
|
|
8
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
9
|
+
if (!client)
|
|
10
|
+
return [];
|
|
11
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
12
|
+
if (filter.guildId) {
|
|
13
|
+
query = query.eq('guild_id', filter.guildId);
|
|
14
|
+
}
|
|
15
|
+
if (filter.command) {
|
|
16
|
+
query = query.eq('command', filter.command);
|
|
17
|
+
}
|
|
18
|
+
const { data, error } = await query;
|
|
19
|
+
if (error) {
|
|
20
|
+
console.error('SpaceCommands > Error fetching required roles:', error);
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return (data || []).map((row) => ({
|
|
24
|
+
guildId: row.guild_id,
|
|
25
|
+
command: row.command,
|
|
26
|
+
requiredRoles: row.required_roles,
|
|
27
|
+
}));
|
|
28
|
+
},
|
|
29
|
+
async findOne(filter) {
|
|
30
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
31
|
+
if (!client)
|
|
32
|
+
return null;
|
|
33
|
+
let query = client.from(TABLE_NAME).select('*');
|
|
34
|
+
if (filter.guildId) {
|
|
35
|
+
query = query.eq('guild_id', filter.guildId);
|
|
36
|
+
}
|
|
37
|
+
if (filter.command) {
|
|
38
|
+
query = query.eq('command', filter.command);
|
|
39
|
+
}
|
|
40
|
+
const { data, error } = await query.single();
|
|
41
|
+
if (error) {
|
|
42
|
+
if (error.code === 'PGRST116')
|
|
43
|
+
return null;
|
|
44
|
+
console.error('SpaceCommands > Error finding required roles:', error);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
guildId: data.guild_id,
|
|
49
|
+
command: data.command,
|
|
50
|
+
requiredRoles: data.required_roles,
|
|
24
51
|
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
const mongoose_1 = __importStar(require("mongoose"));
|
|
36
|
-
const reqString = {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
};
|
|
40
|
-
const schema = new mongoose_1.Schema({
|
|
41
|
-
guildId: reqString,
|
|
42
|
-
command: reqString,
|
|
43
|
-
requiredRoles: {
|
|
44
|
-
type: [String],
|
|
45
|
-
required: true,
|
|
46
52
|
},
|
|
47
|
-
})
|
|
48
|
-
const
|
|
49
|
-
|
|
53
|
+
async findOneAndUpdate(filter, update, options = {}) {
|
|
54
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
55
|
+
if (!client)
|
|
56
|
+
return null;
|
|
57
|
+
const guildId = filter.guildId;
|
|
58
|
+
const command = filter.command || update.command || update.$set?.command;
|
|
59
|
+
const requiredRoles = update.requiredRoles || update.$set?.requiredRoles;
|
|
60
|
+
const { data, error } = await client
|
|
61
|
+
.from(TABLE_NAME)
|
|
62
|
+
.upsert({ guild_id: guildId, command, required_roles: requiredRoles }, { onConflict: 'guild_id,command' })
|
|
63
|
+
.select()
|
|
64
|
+
.single();
|
|
65
|
+
if (error) {
|
|
66
|
+
console.error('SpaceCommands > Error upserting required roles:', error);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
guildId: data.guild_id,
|
|
71
|
+
command: data.command,
|
|
72
|
+
requiredRoles: data.required_roles,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
async deleteOne(filter) {
|
|
76
|
+
const client = (0, supabase_1.getSupabaseClient)();
|
|
77
|
+
if (!client)
|
|
78
|
+
return { deletedCount: 0 };
|
|
79
|
+
let query = client.from(TABLE_NAME).delete();
|
|
80
|
+
if (filter.guildId) {
|
|
81
|
+
query = query.eq('guild_id', filter.guildId);
|
|
82
|
+
}
|
|
83
|
+
if (filter.command) {
|
|
84
|
+
query = query.eq('command', filter.command);
|
|
85
|
+
}
|
|
86
|
+
const { error } = await query;
|
|
87
|
+
if (error) {
|
|
88
|
+
console.error('SpaceCommands > Error deleting required roles:', error);
|
|
89
|
+
return { deletedCount: 0 };
|
|
90
|
+
}
|
|
91
|
+
return { deletedCount: 1 };
|
|
92
|
+
},
|
|
93
|
+
};
|
package/dist/mongo.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getMongoConnection = void 0;
|
|
7
|
+
// @ts-nocheck
|
|
7
8
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
9
|
const Events_1 = __importDefault(require("./enums/Events"));
|
|
9
10
|
const results = {
|
package/dist/supabase.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSupabaseClient = exports.initSupabase = void 0;
|
|
4
|
+
const supabase_js_1 = require("@supabase/supabase-js");
|
|
5
|
+
let supabase = null;
|
|
6
|
+
const initSupabase = (url, key) => {
|
|
7
|
+
if (!url || !key) {
|
|
8
|
+
console.warn('SpaceCommands > Supabase URL or Key not provided.');
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
supabase = (0, supabase_js_1.createClient)(url, key);
|
|
12
|
+
};
|
|
13
|
+
exports.initSupabase = initSupabase;
|
|
14
|
+
const getSupabaseClient = () => {
|
|
15
|
+
return supabase;
|
|
16
|
+
};
|
|
17
|
+
exports.getSupabaseClient = getSupabaseClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spacecommands",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "./typings.d.ts",
|
|
6
6
|
"typings": "./typings.d.ts",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"author": "SpaceCommands Contributors",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
41
|
+
"@supabase/supabase-js": "^2.89.0",
|
|
42
|
+
"discord.js": "^14.0.0",
|
|
43
|
+
"dotenv": "^16.4.7"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.10.5",
|
package/typings.d.ts
CHANGED
|
@@ -18,8 +18,6 @@ export default class SpaceCommands extends EventEmitter {
|
|
|
18
18
|
private _defaultPrefix: string
|
|
19
19
|
private _commandsDir: string
|
|
20
20
|
private _featuresDir: string
|
|
21
|
-
private _mongo: string | undefined
|
|
22
|
-
private _mongoConnection: Connection | null
|
|
23
21
|
private _displayName: string
|
|
24
22
|
private _prefixes: { [name: string]: string }
|
|
25
23
|
private _categories: Map<String, String | GuildEmoji>
|
|
@@ -45,8 +43,6 @@ export default class SpaceCommands extends EventEmitter {
|
|
|
45
43
|
|
|
46
44
|
constructor(client: Client, options?: Options)
|
|
47
45
|
|
|
48
|
-
public get mongoPath(): string
|
|
49
|
-
public setMongoPath(mongoPath: string | undefined): SpaceCommands
|
|
50
46
|
public get client(): Client
|
|
51
47
|
public get displayName(): string
|
|
52
48
|
public setDisplayName(displayName: string): SpaceCommands
|
|
@@ -67,10 +63,6 @@ export default class SpaceCommands extends EventEmitter {
|
|
|
67
63
|
): SpaceCommands
|
|
68
64
|
public isEmojiUsed(emoji: string): boolean
|
|
69
65
|
public get commandHandler(): CommandHandler
|
|
70
|
-
public get mongoConnection(): Connection | null
|
|
71
|
-
public isDBConnected(): boolean
|
|
72
|
-
public setTagPeople(tagPeople: boolean): SpaceCommands
|
|
73
|
-
public get tagPeople(): boolean
|
|
74
66
|
public get showWarns(): boolean
|
|
75
67
|
public get delErrMsgCooldown(): number
|
|
76
68
|
public get ignoreBots(): boolean
|
|
@@ -99,7 +91,8 @@ interface OptionsWithS {
|
|
|
99
91
|
modalsDir?: string
|
|
100
92
|
contextMenusDir?: string
|
|
101
93
|
messagesPath?: string
|
|
102
|
-
|
|
94
|
+
supabaseUrl: string
|
|
95
|
+
supabaseKey: string
|
|
103
96
|
showWarns?: boolean
|
|
104
97
|
delErrMsgCooldown?: number
|
|
105
98
|
defaultLanguage?: string
|
|
@@ -123,7 +116,8 @@ interface OptionsWithoutS {
|
|
|
123
116
|
modalsDir?: string
|
|
124
117
|
contextMenusDir?: string
|
|
125
118
|
messagesPath?: string
|
|
126
|
-
|
|
119
|
+
supabaseUrl: string
|
|
120
|
+
supabaseKey: string
|
|
127
121
|
showWarns?: boolean
|
|
128
122
|
delErrMsgCooldown?: number
|
|
129
123
|
defaultLanguage?: string
|