@spatulox/simplediscordbot 1.0.19 → 1.0.21
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/bot/Bot.js
CHANGED
|
@@ -45,7 +45,7 @@ class Bot {
|
|
|
45
45
|
await Bot.log.initDiscordLogging();
|
|
46
46
|
Log_1.Log.info(`Connected on ${Bot._client.guilds.cache.size} servers as ${Bot._client.user.tag}`);
|
|
47
47
|
//Bot._client.guilds.cache.forEach(g => console.log(` - ${g.name}`));
|
|
48
|
-
Bot.log.
|
|
48
|
+
Bot.log.info(EmbedManager_1.EmbedManager.description("Bot Started"));
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
}
|
package/dist/bot/BotEnv.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.BotEnv = void 0;
|
|
7
|
-
|
|
4
|
+
//import dotenv from 'dotenv';
|
|
8
5
|
const DiscordRegex_1 = require("../utils/DiscordRegex");
|
|
9
|
-
|
|
6
|
+
//dotenv.config();
|
|
10
7
|
exports.BotEnv = {
|
|
11
8
|
get token() {
|
|
12
9
|
const token = process.env.DISCORD_BOT_TOKEN;
|
package/dist/bot/BotLog.d.ts
CHANGED
|
@@ -35,18 +35,18 @@ export declare class BotLog {
|
|
|
35
35
|
/**
|
|
36
36
|
* Send INFO log - TEXT or EMBED ! Respecte config.log.info
|
|
37
37
|
*/
|
|
38
|
-
static
|
|
38
|
+
static info(content: string | EmbedBuilder): Promise<Message | void>;
|
|
39
39
|
/**
|
|
40
40
|
* Send ERROR log - TEXT or EMBED ! Respecte config.log.error
|
|
41
41
|
*/
|
|
42
|
-
static
|
|
42
|
+
static error(content: string | EmbedBuilder): Promise<Message | void>;
|
|
43
43
|
/**
|
|
44
44
|
* Send WARNING log - TEXT or EMBED ! Respecte config.log.warn
|
|
45
45
|
*/
|
|
46
|
-
static
|
|
46
|
+
static warn(content: string | EmbedBuilder): Promise<Message | void>;
|
|
47
47
|
/**
|
|
48
48
|
* Send DEBUG log - TEXT or EMBED ! Respecte config.log.debug
|
|
49
49
|
*/
|
|
50
|
-
static
|
|
50
|
+
static debug(content: string | EmbedBuilder): Promise<Message | void>;
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=BotLog.d.ts.map
|
package/dist/bot/BotLog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotLog.d.ts","sourceRoot":"","sources":["../../src/bot/BotLog.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,YAAY,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAI9D,MAAM,MAAM,SAAS,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAA;IAC1C,KAAK,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAA;IAC3C,IAAI,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAA;IAC1C,KAAK,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAA;CAC9C,CAAA;AAED,qBAAa,MAAM;IACf,OAAO,CAAC,MAAM,CAAC,UAAU,CAA4B;IACrD,OAAO,CAAC,MAAM,CAAE,YAAY,CAA4B;;IAIxD,MAAM,CAAC,MAAM,IAAI,SAAS,GAAG,SAAS;IAItC;;OAEG;WACiB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCvD;;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AAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAY9E"}
|
package/dist/bot/BotLog.js
CHANGED
|
@@ -71,7 +71,7 @@ class BotLog {
|
|
|
71
71
|
/**
|
|
72
72
|
* Send INFO log - TEXT or EMBED ! Respecte config.log.info
|
|
73
73
|
*/
|
|
74
|
-
static async
|
|
74
|
+
static async info(content) {
|
|
75
75
|
const logConfig = Bot_1.Bot.config.log;
|
|
76
76
|
// 1. CONSOLE selon config (ou défaut ON)
|
|
77
77
|
if (!logConfig || logConfig.info.console) {
|
|
@@ -87,7 +87,7 @@ class BotLog {
|
|
|
87
87
|
/**
|
|
88
88
|
* Send ERROR log - TEXT or EMBED ! Respecte config.log.error
|
|
89
89
|
*/
|
|
90
|
-
static async
|
|
90
|
+
static async error(content) {
|
|
91
91
|
const logConfig = Bot_1.Bot.config.log;
|
|
92
92
|
// 1. CONSOLE selon config (ou défaut ON)
|
|
93
93
|
if (!logConfig || logConfig.error.console) {
|
|
@@ -103,7 +103,7 @@ class BotLog {
|
|
|
103
103
|
/**
|
|
104
104
|
* Send WARNING log - TEXT or EMBED ! Respecte config.log.warn
|
|
105
105
|
*/
|
|
106
|
-
static async
|
|
106
|
+
static async warn(content) {
|
|
107
107
|
const logConfig = Bot_1.Bot.config.log;
|
|
108
108
|
if (!logConfig || logConfig?.warn.console) {
|
|
109
109
|
if (!(content instanceof discord_js_1.EmbedBuilder)) {
|
|
@@ -117,7 +117,7 @@ class BotLog {
|
|
|
117
117
|
/**
|
|
118
118
|
* Send DEBUG log - TEXT or EMBED ! Respecte config.log.debug
|
|
119
119
|
*/
|
|
120
|
-
static async
|
|
120
|
+
static async debug(content) {
|
|
121
121
|
const logConfig = Bot_1.Bot.config.log;
|
|
122
122
|
if (!logConfig || logConfig?.debug.console) {
|
|
123
123
|
if (!(content instanceof discord_js_1.EmbedBuilder)) {
|
|
@@ -124,7 +124,7 @@ class FileManager {
|
|
|
124
124
|
catch (error) {
|
|
125
125
|
const cleanFilename = filename.replace(/\.json$/i, '') || 'unknown';
|
|
126
126
|
if (sendErrorToErrorChannel) {
|
|
127
|
-
await Bot_1.Bot.log.
|
|
127
|
+
await Bot_1.Bot.log.info(EmbedManager_1.EmbedManager.error(`Failed to write file ${directoryPath}/${cleanFilename}.json: ${error}`));
|
|
128
128
|
}
|
|
129
129
|
else {
|
|
130
130
|
Log_1.Log.error(`Failed to write file ${directoryPath}/${cleanFilename}.json: ${error}`);
|
|
@@ -41,7 +41,7 @@ class GuildUserManager extends BasicUserManager_1.BasicUserManager {
|
|
|
41
41
|
await (0, promises_1.setTimeout)(1000);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
Bot_1.Bot.log.
|
|
44
|
+
Bot_1.Bot.log.info(EmbedManager_1.EmbedManager.error(`Failed to rename ${member.displayName} to ${nickname.trim()} after ${maxAttempts} attempts.`));
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
47
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spatulox/simplediscordbot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"author": "Spatulox",
|
|
5
5
|
"description": "Simple discord bot framework to set up a bot under 30 secondes",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsc",
|
|
13
|
-
"patch": "
|
|
12
|
+
"build": "rm -rf ./dist && tsc",
|
|
13
|
+
"patch": "npm run build && npm version patch",
|
|
14
14
|
"publish": "npm run patch && npm publish --access public",
|
|
15
15
|
"dev": "nodemon --exec tsx src/test/index.ts"
|
|
16
16
|
},
|