@spatulox/simplediscordbot 1.0.19 → 1.0.22

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Bot.d.ts","sourceRoot":"","sources":["../../src/bot/Bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,YAAY,EAAkB,MAAM,YAAY,CAAC;AAKjE,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,UAAU,EAAe,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAShD,MAAM,MAAM,SAAS,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAA;CACnB,GAAG,SAAS,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,EAAE,CAAA;AAEvE,qBAAa,GAAG;IAGZ,gBAAuB,GAAG,gBAAS;IACnC,gBAAuB,OAAO,oBAAa;IAC3C,gBAAuB,WAAW,wBAAiB;IAGnD,OAAc,OAAO,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAe;IAC1C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAoB;IAE1C,IAAI,MAAM,IAAI,iBAAiB,CAAwB;IACvD,IAAI,MAAM,IAAI,MAAM,CAAwB;IAE5C,MAAM,KAAK,MAAM,IAAI,MAAM,CAAwB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AC;IAC9B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAe;IAC1C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAoB;IAE1C,IAAI,MAAM,IAAI,iBAAiB,CAAwB;IACvD,IAAI,MAAM,IAAI,MAAM,CAAwB;IAE5C,MAAM,KAAK,MAAM,IAAI,MAAM,CAAwB;IACnD,MAAM,KAAK,MAAM,IAAI,iBAAiB,CAAwB;gBAElD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;IAoBhC,KAAK,CAAC,QAAQ,GAAE,MAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC1D,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;IAOtD,MAAM,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,EAAE,UAAU,GAAE,MAAM,GAAG,IAAW;CA0B/F"}
package/dist/bot/Bot.js CHANGED
@@ -1,11 +1,7 @@
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.Bot = void 0;
7
4
  const discord_js_1 = require("discord.js");
8
- const dotenv_1 = __importDefault(require("dotenv"));
9
5
  const UnitTime_1 = require("../utils/times/UnitTime");
10
6
  const Log_1 = require("../utils/Log");
11
7
  const InternetChecker_1 = require("../utils/network/InternetChecker");
@@ -14,7 +10,6 @@ const EmbedManager_1 = require("../manager/messages/EmbedManager");
14
10
  const BotMessage_1 = require("./BotMessage");
15
11
  const BotEnv_1 = require("./BotEnv");
16
12
  const BotInteraction_1 = require("./BotInteraction");
17
- dotenv_1.default.config();
18
13
  class Bot {
19
14
  get config() { return Bot._config; }
20
15
  get client() { return Bot._client; }
@@ -45,7 +40,7 @@ class Bot {
45
40
  await Bot.log.initDiscordLogging();
46
41
  Log_1.Log.info(`Connected on ${Bot._client.guilds.cache.size} servers as ${Bot._client.user.tag}`);
47
42
  //Bot._client.guilds.cache.forEach(g => console.log(` - ${g.name}`));
48
- Bot.log.sendLog(EmbedManager_1.EmbedManager.description("Bot Started"));
43
+ Bot.log.info(EmbedManager_1.EmbedManager.description("Bot Started"));
49
44
  }
50
45
  });
51
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BotEnv.d.ts","sourceRoot":"","sources":["../../src/bot/BotEnv.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;oBACF,MAAM;kBAKR,OAAO;uBAGF,MAAM;CAUhB,CAAC"}
1
+ {"version":3,"file":"BotEnv.d.ts","sourceRoot":"","sources":["../../src/bot/BotEnv.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;oBACF,MAAM;kBAKR,OAAO;uBAGF,MAAM;CAUhB,CAAC"}
@@ -1,12 +1,7 @@
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
- const dotenv_1 = __importDefault(require("dotenv"));
8
4
  const DiscordRegex_1 = require("../utils/DiscordRegex");
9
- dotenv_1.default.config();
10
5
  exports.BotEnv = {
11
6
  get token() {
12
7
  const token = process.env.DISCORD_BOT_TOKEN;
@@ -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 sendLog(content: string | EmbedBuilder): Promise<Message | void>;
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 sendError(content: string | EmbedBuilder): Promise<Message | void>;
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 sendWarn(content: string | EmbedBuilder): Promise<Message | void>;
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 sendDebug(content: string | EmbedBuilder): Promise<Message | void>;
50
+ static debug(content: string | EmbedBuilder): Promise<Message | void>;
51
51
  }
52
52
  //# sourceMappingURL=BotLog.d.ts.map
@@ -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;;OAEG;mBACmB,cAAc;IAsBpC;;OAEG;WACU,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAc7E;;OAEG;WACU,SAAS,CAAC,OAAO,EAAE,MA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;;OAEG;WACU,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAc3E;;OAEG;WACU,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAY1E;;OAEG;WACU,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAY9E"}
@@ -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 sendLog(content) {
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 sendError(content) {
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 sendWarn(content) {
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 sendDebug(content) {
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.sendError(EmbedManager_1.EmbedManager.error(`Failed to write file ${directoryPath}/${cleanFilename}.json: ${error}`));
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.sendLog(EmbedManager_1.EmbedManager.error(`Failed to rename ${member.displayName} to ${nickname.trim()} after ${maxAttempts} attempts.`));
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
  /**
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const dotenv_1 = __importDefault(require("dotenv"));
3
7
  const index_1 = require("../index");
4
8
  const client_1 = require("./client");
5
9
  const discord_js_1 = require("discord.js");
6
10
  const randomActivityList_1 = require("./randomActivityList");
11
+ dotenv_1.default.config();
7
12
  async function main() {
8
13
  const config = {
9
14
  defaultEmbedColor: index_1.EmbedColor.blue, // (When embed are created with EmbedManager)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spatulox/simplediscordbot",
3
- "version": "1.0.19",
3
+ "version": "1.0.22",
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,9 +9,9 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "build": "tsc",
13
- "patch": "rm -rf ./dist && npm run build && npm version patch",
14
- "publish": "npm run patch && npm publish --access public",
12
+ "build": "rm -rf ./dist && tsc",
13
+ "patch": "npm run build && npm version patch",
14
+ "pub": "npm run patch && npm publish --access public",
15
15
  "dev": "nodemon --exec tsx src/test/index.ts"
16
16
  },
17
17
  "license": "MIT",