@spatulox/simplediscordbot 1.0.35 → 1.0.37
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +79 -67
- package/dist/index.mjs +35 -25
- package/package.json +1 -1
- package/.env.HDFR_dev +0 -3
- package/.env.SpatuloxTest +0 -3
- package/.npmignore_old +0 -23
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -534,7 +534,7 @@ var EmbedManager = class {
|
|
|
534
534
|
* Creates simple embed with just description
|
|
535
535
|
*/
|
|
536
536
|
static simple(description, color = null) {
|
|
537
|
-
return this.create(color).setDescription(description)
|
|
537
|
+
return this.create(color).setDescription(description);
|
|
538
538
|
}
|
|
539
539
|
/**
|
|
540
540
|
* Creates error embed
|
|
@@ -549,10 +549,10 @@ var EmbedManager = class {
|
|
|
549
549
|
return this.create(25600 /* minecraft */).setTitle("Success").setDescription(description);
|
|
550
550
|
}
|
|
551
551
|
/**
|
|
552
|
-
* Creates
|
|
552
|
+
* Creates a simply description embed
|
|
553
553
|
*/
|
|
554
554
|
static description(description) {
|
|
555
|
-
return this.create(
|
|
555
|
+
return this.create().setDescription(description).setFooter(null);
|
|
556
556
|
}
|
|
557
557
|
/**
|
|
558
558
|
* Creates debug embed
|
|
@@ -1270,9 +1270,6 @@ var WebhookManager = class {
|
|
|
1270
1270
|
};
|
|
1271
1271
|
|
|
1272
1272
|
// src/manager/guild/ChannelManager/GuildTextChannelManager.ts
|
|
1273
|
-
var import_discord8 = require("discord.js");
|
|
1274
|
-
|
|
1275
|
-
// src/manager/guild/ChannelManager/GuildChannelManager.ts
|
|
1276
1273
|
var import_discord7 = require("discord.js");
|
|
1277
1274
|
|
|
1278
1275
|
// src/manager/guild/ChannelManager/GuildMessageManager.ts
|
|
@@ -1377,33 +1374,48 @@ var _GuildChannelManager = class _GuildChannelManager {
|
|
|
1377
1374
|
}
|
|
1378
1375
|
}
|
|
1379
1376
|
static async find(channelId) {
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1377
|
+
try {
|
|
1378
|
+
const cached = Bot.client.channels.cache.get(channelId);
|
|
1379
|
+
if (cached && !cached.isDMBased()) return cached;
|
|
1380
|
+
const channel = await Bot.client.channels.fetch(channelId);
|
|
1381
|
+
if (channel && !channel.isDMBased()) return channel;
|
|
1382
|
+
Log.warn(`Channel ${channelId} not found in any guild`);
|
|
1383
|
+
return null;
|
|
1384
|
+
} catch (error) {
|
|
1385
|
+
Log.error(`Failed to find channel ${channelId}: ${error}`);
|
|
1386
|
+
return null;
|
|
1387
|
+
}
|
|
1386
1388
|
}
|
|
1387
1389
|
static findAll(guildId) {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1390
|
+
try {
|
|
1391
|
+
const guild = Bot.client.guilds.cache.get(guildId);
|
|
1392
|
+
if (!guild) {
|
|
1393
|
+
Log.warn(`Guild ${guildId} not found`);
|
|
1394
|
+
return [];
|
|
1395
|
+
}
|
|
1396
|
+
return Array.from(guild.channels.cache.values());
|
|
1397
|
+
} catch (error) {
|
|
1398
|
+
Log.error(`Failed to find channel ${guildId}: ${error}`);
|
|
1391
1399
|
return [];
|
|
1392
1400
|
}
|
|
1393
|
-
return Array.from(guild.channels.cache.values());
|
|
1394
1401
|
}
|
|
1395
1402
|
/**
|
|
1396
1403
|
* Recherche channels par nom (insensible à la casse)
|
|
1397
1404
|
*/
|
|
1398
1405
|
static findByName(guildId, name) {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1406
|
+
try {
|
|
1407
|
+
const guild = Bot.client.guilds.cache.get(guildId);
|
|
1408
|
+
if (!guild) {
|
|
1409
|
+
Log.warn(`Guild ${guildId} not found`);
|
|
1410
|
+
return [];
|
|
1411
|
+
}
|
|
1412
|
+
return Array.from(guild.channels.cache.values()).filter(
|
|
1413
|
+
(channel) => channel.name.toLowerCase().includes(name.toLowerCase())
|
|
1414
|
+
);
|
|
1415
|
+
} catch (error) {
|
|
1416
|
+
Log.error(`Failed to find channel ${guildId}: ${error}`);
|
|
1402
1417
|
return [];
|
|
1403
1418
|
}
|
|
1404
|
-
return Array.from(guild.channels.cache.values()).filter(
|
|
1405
|
-
(channel) => channel.name.toLowerCase().includes(name.toLowerCase())
|
|
1406
|
-
);
|
|
1407
1419
|
}
|
|
1408
1420
|
static async _create(guildId, options) {
|
|
1409
1421
|
try {
|
|
@@ -1453,12 +1465,12 @@ var GuildTextChannelManager = class extends GuildChannelManager {
|
|
|
1453
1465
|
Log.warn(`Guild ${guildId} not found`);
|
|
1454
1466
|
return [];
|
|
1455
1467
|
}
|
|
1456
|
-
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof
|
|
1468
|
+
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof import_discord7.TextChannel);
|
|
1457
1469
|
}
|
|
1458
1470
|
static async create(guildId, name, options) {
|
|
1459
1471
|
return await super._create(guildId, {
|
|
1460
1472
|
name,
|
|
1461
|
-
type:
|
|
1473
|
+
type: import_discord7.ChannelType.GuildText,
|
|
1462
1474
|
...options
|
|
1463
1475
|
});
|
|
1464
1476
|
}
|
|
@@ -1555,10 +1567,10 @@ var ReactionManager = class {
|
|
|
1555
1567
|
};
|
|
1556
1568
|
|
|
1557
1569
|
// src/manager/guild/GuildManager.ts
|
|
1558
|
-
var
|
|
1570
|
+
var import_discord14 = require("discord.js");
|
|
1559
1571
|
|
|
1560
1572
|
// src/manager/direct/BasicUserManager.ts
|
|
1561
|
-
var
|
|
1573
|
+
var import_discord8 = require("discord.js");
|
|
1562
1574
|
var BasicUserManager = class {
|
|
1563
1575
|
/**
|
|
1564
1576
|
* Find member in specific guild
|
|
@@ -1616,7 +1628,7 @@ var BasicUserManager = class {
|
|
|
1616
1628
|
payload = content_or_component_or_options;
|
|
1617
1629
|
}
|
|
1618
1630
|
const message = await dmChannel.send(payload);
|
|
1619
|
-
if (user instanceof
|
|
1631
|
+
if (user instanceof import_discord8.GuildMember) {
|
|
1620
1632
|
Log.info(`Sent DM to ${user.id} (${user.user.username}): "${(payload.content || "Embed/Component").substring(0, 50)}..."`);
|
|
1621
1633
|
} else {
|
|
1622
1634
|
Log.info(`Sent DM to ${user.id} (${user.username}): "${(payload.content || "Embed/Component").substring(0, 50)}..."`);
|
|
@@ -1630,13 +1642,13 @@ var BasicUserManager = class {
|
|
|
1630
1642
|
};
|
|
1631
1643
|
|
|
1632
1644
|
// src/manager/guild/GuildUserManager.ts
|
|
1633
|
-
var
|
|
1645
|
+
var import_discord9 = require("discord.js");
|
|
1634
1646
|
var import_promises2 = require("timers/promises");
|
|
1635
1647
|
var MAX_NICKNAME_LENGTH = 32;
|
|
1636
1648
|
var GuildUserManager = class extends BasicUserManager {
|
|
1637
1649
|
static async find(userId, guild) {
|
|
1638
1650
|
try {
|
|
1639
|
-
if (guild instanceof
|
|
1651
|
+
if (guild instanceof import_discord9.Guild) {
|
|
1640
1652
|
return await guild.members.fetch(userId);
|
|
1641
1653
|
} else {
|
|
1642
1654
|
return await (await GuildManager.find(guild)).members.fetch(userId);
|
|
@@ -1934,15 +1946,15 @@ var RoleManager = class {
|
|
|
1934
1946
|
};
|
|
1935
1947
|
|
|
1936
1948
|
// src/manager/guild/ChannelManager/ForumChannelManager.ts
|
|
1937
|
-
var
|
|
1949
|
+
var import_discord10 = require("discord.js");
|
|
1938
1950
|
var ForumChannelManager = class extends GuildChannelManager {
|
|
1939
1951
|
static async findInGuild(guildId, channelId) {
|
|
1940
1952
|
const channel = await super.findInGuild(guildId, channelId);
|
|
1941
|
-
return channel instanceof
|
|
1953
|
+
return channel instanceof import_discord10.ForumChannel ? channel : null;
|
|
1942
1954
|
}
|
|
1943
1955
|
static async find(channelId) {
|
|
1944
1956
|
const channel = await super.find(channelId);
|
|
1945
|
-
return channel instanceof
|
|
1957
|
+
return channel instanceof import_discord10.ForumChannel ? channel : null;
|
|
1946
1958
|
}
|
|
1947
1959
|
static findAll(guildId) {
|
|
1948
1960
|
const guild = Bot.client.guilds.cache.get(guildId);
|
|
@@ -1950,27 +1962,27 @@ var ForumChannelManager = class extends GuildChannelManager {
|
|
|
1950
1962
|
Log.warn(`Guild ${guildId} not found`);
|
|
1951
1963
|
return [];
|
|
1952
1964
|
}
|
|
1953
|
-
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof
|
|
1965
|
+
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof import_discord10.ForumChannel);
|
|
1954
1966
|
}
|
|
1955
1967
|
static async create(guildId, name, options) {
|
|
1956
1968
|
return await super._create(guildId, {
|
|
1957
1969
|
name,
|
|
1958
|
-
type:
|
|
1970
|
+
type: import_discord10.ChannelType.GuildForum,
|
|
1959
1971
|
...options
|
|
1960
1972
|
});
|
|
1961
1973
|
}
|
|
1962
1974
|
};
|
|
1963
1975
|
|
|
1964
1976
|
// src/manager/guild/ChannelManager/NewsChannelManager.ts
|
|
1965
|
-
var
|
|
1977
|
+
var import_discord11 = require("discord.js");
|
|
1966
1978
|
var NewsChannelManager = class extends GuildChannelManager {
|
|
1967
1979
|
static async findInGuild(guildId, channelId) {
|
|
1968
1980
|
const channel = await super.findInGuild(guildId, channelId);
|
|
1969
|
-
return channel instanceof
|
|
1981
|
+
return channel instanceof import_discord11.NewsChannel ? channel : null;
|
|
1970
1982
|
}
|
|
1971
1983
|
static async find(channelId) {
|
|
1972
1984
|
const channel = await super.find(channelId);
|
|
1973
|
-
return channel instanceof
|
|
1985
|
+
return channel instanceof import_discord11.NewsChannel ? channel : null;
|
|
1974
1986
|
}
|
|
1975
1987
|
static findAll(guildId) {
|
|
1976
1988
|
const guild = Bot.client.guilds.cache.get(guildId);
|
|
@@ -1978,27 +1990,27 @@ var NewsChannelManager = class extends GuildChannelManager {
|
|
|
1978
1990
|
Log.warn(`Guild ${guildId} not found`);
|
|
1979
1991
|
return [];
|
|
1980
1992
|
}
|
|
1981
|
-
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof
|
|
1993
|
+
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof import_discord11.NewsChannel);
|
|
1982
1994
|
}
|
|
1983
1995
|
static async create(guildId, name, options) {
|
|
1984
1996
|
return await super._create(guildId, {
|
|
1985
1997
|
name,
|
|
1986
|
-
type:
|
|
1998
|
+
type: import_discord11.ChannelType.GuildAnnouncement,
|
|
1987
1999
|
...options
|
|
1988
2000
|
});
|
|
1989
2001
|
}
|
|
1990
2002
|
};
|
|
1991
2003
|
|
|
1992
2004
|
// src/manager/guild/ChannelManager/StageChannelManager.ts
|
|
1993
|
-
var
|
|
2005
|
+
var import_discord12 = require("discord.js");
|
|
1994
2006
|
var StageChannelManager = class extends GuildChannelManager {
|
|
1995
2007
|
static async findInGuild(guildId, channelId) {
|
|
1996
2008
|
const channel = await super.findInGuild(guildId, channelId);
|
|
1997
|
-
return channel instanceof
|
|
2009
|
+
return channel instanceof import_discord12.StageChannel ? channel : null;
|
|
1998
2010
|
}
|
|
1999
2011
|
static async find(channelId) {
|
|
2000
2012
|
const channel = await super.find(channelId);
|
|
2001
|
-
return channel instanceof
|
|
2013
|
+
return channel instanceof import_discord12.StageChannel ? channel : null;
|
|
2002
2014
|
}
|
|
2003
2015
|
static findAll(guildId) {
|
|
2004
2016
|
const guild = Bot.client.guilds.cache.get(guildId);
|
|
@@ -2006,12 +2018,12 @@ var StageChannelManager = class extends GuildChannelManager {
|
|
|
2006
2018
|
Log.warn(`Guild ${guildId} not found`);
|
|
2007
2019
|
return [];
|
|
2008
2020
|
}
|
|
2009
|
-
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof
|
|
2021
|
+
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof import_discord12.StageChannel);
|
|
2010
2022
|
}
|
|
2011
2023
|
static async create(guildId, name, options) {
|
|
2012
2024
|
return await super._create(guildId, {
|
|
2013
2025
|
name,
|
|
2014
|
-
type:
|
|
2026
|
+
type: import_discord12.ChannelType.GuildStageVoice,
|
|
2015
2027
|
...options
|
|
2016
2028
|
});
|
|
2017
2029
|
}
|
|
@@ -2059,7 +2071,7 @@ var ThreadChannelManager = class {
|
|
|
2059
2071
|
};
|
|
2060
2072
|
|
|
2061
2073
|
// src/manager/guild/ChannelManager/GuildVoiceChannelManager.ts
|
|
2062
|
-
var
|
|
2074
|
+
var import_discord13 = require("discord.js");
|
|
2063
2075
|
var GuildVoiceChannelManager = class extends GuildChannelManager {
|
|
2064
2076
|
static async findInGuild(guildId, channelId) {
|
|
2065
2077
|
const channel = await super.findInGuild(guildId, channelId);
|
|
@@ -2075,12 +2087,12 @@ var GuildVoiceChannelManager = class extends GuildChannelManager {
|
|
|
2075
2087
|
Log.warn(`Guild ${guildId} not found`);
|
|
2076
2088
|
return [];
|
|
2077
2089
|
}
|
|
2078
|
-
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof
|
|
2090
|
+
return Array.from(guild.channels.cache.values()).filter((c) => c instanceof import_discord13.VoiceChannel);
|
|
2079
2091
|
}
|
|
2080
2092
|
static async create(guildId, name, options) {
|
|
2081
2093
|
return await super._create(guildId, {
|
|
2082
2094
|
name,
|
|
2083
|
-
type:
|
|
2095
|
+
type: import_discord13.ChannelType.GuildVoice,
|
|
2084
2096
|
...options
|
|
2085
2097
|
});
|
|
2086
2098
|
}
|
|
@@ -2201,7 +2213,7 @@ var GuildManager = class {
|
|
|
2201
2213
|
*/
|
|
2202
2214
|
static async fetchAllMembers(guildId, MAX_ATTEMPTS = 3, RETRY_DELAY = Time.minute.MIN_05.toMilliseconds()) {
|
|
2203
2215
|
let guild;
|
|
2204
|
-
if (guildId instanceof
|
|
2216
|
+
if (guildId instanceof import_discord14.Guild) {
|
|
2205
2217
|
guild = guildId;
|
|
2206
2218
|
} else {
|
|
2207
2219
|
let tmp = Bot.client.guilds.cache.get(guildId);
|
|
@@ -2254,10 +2266,10 @@ var GuildManager = class {
|
|
|
2254
2266
|
if (!toChannel) {
|
|
2255
2267
|
throw new Error(`To channel ${toChannelId} not found`);
|
|
2256
2268
|
}
|
|
2257
|
-
if (!(fromChannel instanceof
|
|
2269
|
+
if (!(fromChannel instanceof import_discord14.VoiceChannel || fromChannel instanceof import_discord14.StageChannel)) {
|
|
2258
2270
|
throw new Error(`From channel ${fromChannelId} is not a voice/stage channel`);
|
|
2259
2271
|
}
|
|
2260
|
-
if (!(toChannel instanceof
|
|
2272
|
+
if (!(toChannel instanceof import_discord14.VoiceChannel || toChannel instanceof import_discord14.StageChannel)) {
|
|
2261
2273
|
throw new Error(`To channel ${toChannelId} is not a voice/stage channel`);
|
|
2262
2274
|
}
|
|
2263
2275
|
if (member.voice.channelId !== fromChannelId) {
|
|
@@ -2294,7 +2306,7 @@ var UserManager = class extends BasicUserManager {
|
|
|
2294
2306
|
};
|
|
2295
2307
|
|
|
2296
2308
|
// src/manager/interactions/ModalManager.ts
|
|
2297
|
-
var
|
|
2309
|
+
var import_discord15 = require("discord.js");
|
|
2298
2310
|
var ModalManager = class _ModalManager {
|
|
2299
2311
|
/**
|
|
2300
2312
|
* Load modal from JSON file and return ModalBuilder
|
|
@@ -2320,17 +2332,17 @@ var ModalManager = class _ModalManager {
|
|
|
2320
2332
|
}
|
|
2321
2333
|
}
|
|
2322
2334
|
static jsonToBuilder(json) {
|
|
2323
|
-
const modal = new
|
|
2335
|
+
const modal = new import_discord15.ModalBuilder().setCustomId(json.customId).setTitle(json.title.slice(0, 45));
|
|
2324
2336
|
const actionRows = [];
|
|
2325
2337
|
for (const fieldJson of json.fields) {
|
|
2326
2338
|
const input = this.fieldJsonToInput(fieldJson);
|
|
2327
|
-
const row = new
|
|
2339
|
+
const row = new import_discord15.ActionRowBuilder().addComponents(input);
|
|
2328
2340
|
actionRows.push(row);
|
|
2329
2341
|
}
|
|
2330
2342
|
return modal.addComponents(...actionRows);
|
|
2331
2343
|
}
|
|
2332
2344
|
static fieldJsonToInput(fieldJson) {
|
|
2333
|
-
const input = new
|
|
2345
|
+
const input = new import_discord15.TextInputBuilder().setCustomId(fieldJson.customId).setLabel(fieldJson.title.slice(0, 45)).setPlaceholder(fieldJson.placeholder || "Enter value...").setRequired(fieldJson.required !== false).setMinLength(fieldJson.minLength || 0).setMaxLength(fieldJson.maxLength || 400);
|
|
2334
2346
|
const style = fieldJson.style;
|
|
2335
2347
|
if (typeof style === "number") {
|
|
2336
2348
|
input.setStyle(style);
|
|
@@ -2339,13 +2351,13 @@ var ModalManager = class _ModalManager {
|
|
|
2339
2351
|
case "Number":
|
|
2340
2352
|
case "Phone":
|
|
2341
2353
|
case "Date":
|
|
2342
|
-
input.setStyle(
|
|
2354
|
+
input.setStyle(import_discord15.TextInputStyle.Short);
|
|
2343
2355
|
input.setPlaceholder(
|
|
2344
2356
|
style === "Number" ? "123" : style === "Phone" ? "+33 6 12 34 56 78" : "2024-02-05"
|
|
2345
2357
|
);
|
|
2346
2358
|
break;
|
|
2347
2359
|
default:
|
|
2348
|
-
input.setStyle(
|
|
2360
|
+
input.setStyle(import_discord15.TextInputStyle.Short);
|
|
2349
2361
|
}
|
|
2350
2362
|
}
|
|
2351
2363
|
return input;
|
|
@@ -2381,13 +2393,13 @@ var ModalManager = class _ModalManager {
|
|
|
2381
2393
|
};
|
|
2382
2394
|
|
|
2383
2395
|
// src/manager/interactions/SelectMenuManager.ts
|
|
2384
|
-
var
|
|
2396
|
+
var import_discord16 = require("discord.js");
|
|
2385
2397
|
var SelectMenuManager = class {
|
|
2386
2398
|
/**
|
|
2387
2399
|
* Creates base StringSelectMenu - SIMPLE API !
|
|
2388
2400
|
*/
|
|
2389
2401
|
static create(customId, placeholder = "Select an option...") {
|
|
2390
|
-
return new
|
|
2402
|
+
return new import_discord16.StringSelectMenuBuilder().setCustomId(customId).setPlaceholder(placeholder).setMinValues(1).setMaxValues(1);
|
|
2391
2403
|
}
|
|
2392
2404
|
/**
|
|
2393
2405
|
* Quick StringSelectMenu
|
|
@@ -2405,10 +2417,10 @@ var SelectMenuManager = class {
|
|
|
2405
2417
|
* Pagination menu
|
|
2406
2418
|
*/
|
|
2407
2419
|
static paginated(customId, options, pageSize = 25) {
|
|
2408
|
-
const row = new
|
|
2420
|
+
const row = new import_discord16.ActionRowBuilder();
|
|
2409
2421
|
for (let i = 0; i < options.length; i += pageSize) {
|
|
2410
2422
|
const pageOptions = options.slice(i, i + pageSize);
|
|
2411
|
-
const menu = new
|
|
2423
|
+
const menu = new import_discord16.StringSelectMenuBuilder().setCustomId(`${customId}_page_${Math.floor(i / pageSize)}`).setPlaceholder(`Page ${Math.floor(i / pageSize) + 1}`).addOptions(pageOptions.map((opt) => {
|
|
2412
2424
|
return this.option(opt);
|
|
2413
2425
|
}));
|
|
2414
2426
|
row.addComponents(menu);
|
|
@@ -2419,25 +2431,25 @@ var SelectMenuManager = class {
|
|
|
2419
2431
|
* User Select Menu (Components V2)
|
|
2420
2432
|
*/
|
|
2421
2433
|
static users(customId, placeholder = "Select users...") {
|
|
2422
|
-
return new
|
|
2434
|
+
return new import_discord16.UserSelectMenuBuilder().setCustomId(customId).setPlaceholder(placeholder).setMinValues(1).setMaxValues(25);
|
|
2423
2435
|
}
|
|
2424
2436
|
/**
|
|
2425
2437
|
* Role Select Menu (Components V2)
|
|
2426
2438
|
*/
|
|
2427
2439
|
static roles(customId, placeholder = "Select roles...") {
|
|
2428
|
-
return new
|
|
2440
|
+
return new import_discord16.RoleSelectMenuBuilder().setCustomId(customId).setPlaceholder(placeholder).setMinValues(1).setMaxValues(25);
|
|
2429
2441
|
}
|
|
2430
2442
|
/**
|
|
2431
2443
|
* Mentionable Select Menu (Components V2)
|
|
2432
2444
|
*/
|
|
2433
2445
|
static mentionables(customId, placeholder = "Select users/roles...") {
|
|
2434
|
-
return new
|
|
2446
|
+
return new import_discord16.MentionableSelectMenuBuilder().setCustomId(customId).setPlaceholder(placeholder).setMinValues(1).setMaxValues(25);
|
|
2435
2447
|
}
|
|
2436
2448
|
/**
|
|
2437
2449
|
* Channel Select Menu (Components V2)
|
|
2438
2450
|
*/
|
|
2439
2451
|
static channels(customId, placeholder = "Select channels...", channelTypes = []) {
|
|
2440
|
-
return new
|
|
2452
|
+
return new import_discord16.ChannelSelectMenuBuilder().setCustomId(customId).setPlaceholder(placeholder).setMinValues(1).setMaxValues(25).setChannelTypes(...channelTypes);
|
|
2441
2453
|
}
|
|
2442
2454
|
static option(option) {
|
|
2443
2455
|
if (Array.isArray(option)) {
|
|
@@ -2446,7 +2458,7 @@ var SelectMenuManager = class {
|
|
|
2446
2458
|
return this._createOption(option);
|
|
2447
2459
|
}
|
|
2448
2460
|
static _createOption(option) {
|
|
2449
|
-
const builder = new
|
|
2461
|
+
const builder = new import_discord16.StringSelectMenuOptionBuilder().setLabel(option.label).setValue(option.value);
|
|
2450
2462
|
option.description && builder.setDescription(option.description);
|
|
2451
2463
|
option.emoji && builder.setEmoji(option.emoji);
|
|
2452
2464
|
return builder;
|
|
@@ -2467,7 +2479,7 @@ var SelectMenuManager = class {
|
|
|
2467
2479
|
* ActionRow
|
|
2468
2480
|
*/
|
|
2469
2481
|
static row(component) {
|
|
2470
|
-
return new
|
|
2482
|
+
return new import_discord16.ActionRowBuilder().addComponents(component);
|
|
2471
2483
|
}
|
|
2472
2484
|
/**
|
|
2473
2485
|
* Rows multiples (5 max)
|
|
@@ -2520,7 +2532,7 @@ var SimpleMutex = class {
|
|
|
2520
2532
|
// package.json
|
|
2521
2533
|
var package_default = {
|
|
2522
2534
|
name: "@spatulox/simplediscordbot",
|
|
2523
|
-
version: "1.0.
|
|
2535
|
+
version: "1.0.36",
|
|
2524
2536
|
author: "Spatulox",
|
|
2525
2537
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
2526
2538
|
exports: {
|
package/dist/index.mjs
CHANGED
|
@@ -486,7 +486,7 @@ var EmbedManager = class {
|
|
|
486
486
|
* Creates simple embed with just description
|
|
487
487
|
*/
|
|
488
488
|
static simple(description, color = null) {
|
|
489
|
-
return this.create(color).setDescription(description)
|
|
489
|
+
return this.create(color).setDescription(description);
|
|
490
490
|
}
|
|
491
491
|
/**
|
|
492
492
|
* Creates error embed
|
|
@@ -501,10 +501,10 @@ var EmbedManager = class {
|
|
|
501
501
|
return this.create(25600 /* minecraft */).setTitle("Success").setDescription(description);
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
504
|
-
* Creates
|
|
504
|
+
* Creates a simply description embed
|
|
505
505
|
*/
|
|
506
506
|
static description(description) {
|
|
507
|
-
return this.create(
|
|
507
|
+
return this.create().setDescription(description).setFooter(null);
|
|
508
508
|
}
|
|
509
509
|
/**
|
|
510
510
|
* Creates debug embed
|
|
@@ -1233,11 +1233,6 @@ var WebhookManager = class {
|
|
|
1233
1233
|
// src/manager/guild/ChannelManager/GuildTextChannelManager.ts
|
|
1234
1234
|
import { TextChannel as TextChannel4, ChannelType } from "discord.js";
|
|
1235
1235
|
|
|
1236
|
-
// src/manager/guild/ChannelManager/GuildChannelManager.ts
|
|
1237
|
-
import {
|
|
1238
|
-
GuildChannel
|
|
1239
|
-
} from "discord.js";
|
|
1240
|
-
|
|
1241
1236
|
// src/manager/guild/ChannelManager/GuildMessageManager.ts
|
|
1242
1237
|
var GuildMessageManager = class {
|
|
1243
1238
|
/**
|
|
@@ -1340,33 +1335,48 @@ var _GuildChannelManager = class _GuildChannelManager {
|
|
|
1340
1335
|
}
|
|
1341
1336
|
}
|
|
1342
1337
|
static async find(channelId) {
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1338
|
+
try {
|
|
1339
|
+
const cached = Bot.client.channels.cache.get(channelId);
|
|
1340
|
+
if (cached && !cached.isDMBased()) return cached;
|
|
1341
|
+
const channel = await Bot.client.channels.fetch(channelId);
|
|
1342
|
+
if (channel && !channel.isDMBased()) return channel;
|
|
1343
|
+
Log.warn(`Channel ${channelId} not found in any guild`);
|
|
1344
|
+
return null;
|
|
1345
|
+
} catch (error) {
|
|
1346
|
+
Log.error(`Failed to find channel ${channelId}: ${error}`);
|
|
1347
|
+
return null;
|
|
1348
|
+
}
|
|
1349
1349
|
}
|
|
1350
1350
|
static findAll(guildId) {
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1351
|
+
try {
|
|
1352
|
+
const guild = Bot.client.guilds.cache.get(guildId);
|
|
1353
|
+
if (!guild) {
|
|
1354
|
+
Log.warn(`Guild ${guildId} not found`);
|
|
1355
|
+
return [];
|
|
1356
|
+
}
|
|
1357
|
+
return Array.from(guild.channels.cache.values());
|
|
1358
|
+
} catch (error) {
|
|
1359
|
+
Log.error(`Failed to find channel ${guildId}: ${error}`);
|
|
1354
1360
|
return [];
|
|
1355
1361
|
}
|
|
1356
|
-
return Array.from(guild.channels.cache.values());
|
|
1357
1362
|
}
|
|
1358
1363
|
/**
|
|
1359
1364
|
* Recherche channels par nom (insensible à la casse)
|
|
1360
1365
|
*/
|
|
1361
1366
|
static findByName(guildId, name) {
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1367
|
+
try {
|
|
1368
|
+
const guild = Bot.client.guilds.cache.get(guildId);
|
|
1369
|
+
if (!guild) {
|
|
1370
|
+
Log.warn(`Guild ${guildId} not found`);
|
|
1371
|
+
return [];
|
|
1372
|
+
}
|
|
1373
|
+
return Array.from(guild.channels.cache.values()).filter(
|
|
1374
|
+
(channel) => channel.name.toLowerCase().includes(name.toLowerCase())
|
|
1375
|
+
);
|
|
1376
|
+
} catch (error) {
|
|
1377
|
+
Log.error(`Failed to find channel ${guildId}: ${error}`);
|
|
1365
1378
|
return [];
|
|
1366
1379
|
}
|
|
1367
|
-
return Array.from(guild.channels.cache.values()).filter(
|
|
1368
|
-
(channel) => channel.name.toLowerCase().includes(name.toLowerCase())
|
|
1369
|
-
);
|
|
1370
1380
|
}
|
|
1371
1381
|
static async _create(guildId, options) {
|
|
1372
1382
|
try {
|
|
@@ -2500,7 +2510,7 @@ var SimpleMutex = class {
|
|
|
2500
2510
|
// package.json
|
|
2501
2511
|
var package_default = {
|
|
2502
2512
|
name: "@spatulox/simplediscordbot",
|
|
2503
|
-
version: "1.0.
|
|
2513
|
+
version: "1.0.36",
|
|
2504
2514
|
author: "Spatulox",
|
|
2505
2515
|
description: "Simple discord bot framework to set up a bot under 30 secondes",
|
|
2506
2516
|
exports: {
|
package/package.json
CHANGED
package/.env.HDFR_dev
DELETED
package/.env.SpatuloxTest
DELETED
package/.npmignore_old
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# .npmignore
|
|
2
|
-
|
|
3
|
-
# conf files
|
|
4
|
-
tsconfig.json
|
|
5
|
-
.env
|
|
6
|
-
.idea
|
|
7
|
-
.gitattributes
|
|
8
|
-
node_modules/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# project files
|
|
12
|
-
src/
|
|
13
|
-
src_example
|
|
14
|
-
handlers/
|
|
15
|
-
*.ts
|
|
16
|
-
|
|
17
|
-
# npm repo conf
|
|
18
|
-
#!*.d.ts
|
|
19
|
-
|
|
20
|
-
dist/**/*.d.ts
|
|
21
|
-
!dist/index.d.ts
|
|
22
|
-
|
|
23
|
-
dist/**/*.map
|