@power-bots/powerbotlibrary 0.5.3 → 0.5.4

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const discord_js_1 = require("discord.js");
13
+ const main_1 = require("../../main");
14
+ module.exports = {
15
+ data: new discord_js_1.SlashCommandBuilder()
16
+ .setName('info')
17
+ .setDescription('Quick info about this bot'),
18
+ execute(interaction) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ var _a, _b, _c, _d, _e, _f, _g, _h;
21
+ main_1.bot.log.info("hello");
22
+ main_1.bot.log.info(main_1.bot.info);
23
+ let embed = new discord_js_1.EmbedBuilder()
24
+ .setTitle((_b = (_a = main_1.bot.info) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null)
25
+ .setThumbnail((_d = (_c = main_1.bot.info) === null || _c === void 0 ? void 0 : _c.icon) !== null && _d !== void 0 ? _d : "")
26
+ .setDescription((_f = (_e = main_1.bot.info) === null || _e === void 0 ? void 0 : _e.description) !== null && _f !== void 0 ? _f : null)
27
+ .addFields({
28
+ name: "Repository", value: (_h = (_g = main_1.bot.info) === null || _g === void 0 ? void 0 : _g.repo) !== null && _h !== void 0 ? _h : "undefined"
29
+ });
30
+ main_1.bot.log.info(embed.toJSON());
31
+ yield interaction.reply({ embeds: [embed] });
32
+ });
33
+ },
34
+ };
package/dist/lib/bot.js CHANGED
@@ -21,8 +21,9 @@ const discord_js_1 = require("discord.js");
21
21
  const log_1 = require("./log");
22
22
  const db_1 = require("./db");
23
23
  const lang_1 = require("./lang");
24
- var db_2 = require("./db");
25
- Object.defineProperty(exports, "knex", { enumerable: true, get: function () { return db_2.knex; } });
24
+ const db_2 = require("./db");
25
+ var db_3 = require("./db");
26
+ Object.defineProperty(exports, "knex", { enumerable: true, get: function () { return db_3.knex; } });
26
27
  var config_1 = require("./config");
27
28
  Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
28
29
  Object.defineProperty(exports, "ConfigTypes", { enumerable: true, get: function () { return config_1.ConfigTypes; } });
@@ -40,12 +41,19 @@ class Bot {
40
41
  }
41
42
  run() {
42
43
  return __awaiter(this, void 0, void 0, function* () {
44
+ process.stdin.on('data', (dataRaw) => __awaiter(this, void 0, void 0, function* () {
45
+ if (dataRaw.toString().trim() === "q") {
46
+ yield db_2.knex.destroy();
47
+ yield this.client.destroy();
48
+ process.exit();
49
+ }
50
+ }));
43
51
  this.log = new log_1.Log();
44
52
  if (!this.dirname) {
45
53
  this.log.error(`Bot was not setup.`);
46
54
  process.exit();
47
55
  }
48
- this.log.info("Press Control+C to stop the bot");
56
+ this.log.info("Press Q+Return to stop the bot");
49
57
  // ENVIROMENT VARS
50
58
  if (!node_fs_1.default.existsSync(".env")) {
51
59
  this.log.error(`No .env file is in the directory. Please add one`);
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@power-bots/powerbotlibrary",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/main.d.ts",
6
6
  "dependencies": {
7
7
  "@types/better-sqlite3": "^7.6.13",
8
- "@types/node": "^22.15.26",
8
+ "@types/node": "^22.19.21",
9
9
  "better-sqlite3": "^11.10.0",
10
- "discord.js": "^14.19.3",
11
- "dotenv": "^16.5.0",
12
- "knex": "^3.1.0",
13
- "typescript": "^5.8.3"
10
+ "discord.js": "^14.26.4",
11
+ "dotenv": "^16.6.1",
12
+ "knex": "^3.2.10",
13
+ "typescript": "^5.9.3"
14
14
  },
15
15
  "files": [
16
16
  "/dist"