Browse Source

Fix various issues in core

master
benji7425 3 years ago
parent
commit
72b7db32ab
  1. 2
      discord-bot-core/BaseGuildData.js
  2. 2
      discord-bot-core/Client.js
  3. 4
      discord-bot-core/HandleGuildMessage.js
  4. 2
      discord-bot-core/Util.js
  5. 43
      discord-bot-core/package-lock.json
  6. 1
      discord-bot-core/package.json

2
discord-bot-core/BaseGuildData.js

@ -4,6 +4,6 @@ module.exports = class BaseGuildData extends Camo.Document {
constructor() {
super();
this.id = Number;
this.guildID = String;
}
};

2
discord-bot-core/Client.js

@ -67,7 +67,7 @@ module.exports = class Client extends Discord.Client {
}
_onGuildDelete(guild) {
this.guildDataModel.findOneAndDelete({ id: guild.id });
this.guildDataModel.findOneAndDelete({ guildID: guild.id });
CoreUtil.dateLog(`Removed from guild ${guild.name}, removing data for this guild`);
}

4
discord-bot-core/HandleGuildMessage.js

@ -4,13 +4,13 @@ const internalCommands = RequireAll(__dirname + "/core-commands");
function handleGuildMessage(client, message, commands) {
if (isCommand(message))
client.guildDataModel.findOne({ id: message.guild.id })
client.guildDataModel.findOne({ guildID: message.guild.id })
.then(guildData =>
handleGuildCommand(
client,
message,
Object.assign({}, internalCommands, commands),
guildData || client.guildDataModel.create({ id: message.guild.id })
guildData || client.guildDataModel.create({ guildID: message.guild.id })
));
}

2
discord-bot-core/Util.js

@ -23,7 +23,7 @@ function ask(client, textChannel, member, question) {
}
};
client.once("message", handler);
client.on("message", handler);
textChannel.send(member.toString() + " " + question).catch(reject);
});

43
discord-bot-core/package-lock.json

@ -27,7 +27,7 @@
"async-limiter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
"integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg="
},
"base62": {
"version": "0.1.1",
@ -64,6 +64,14 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"cron": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/cron/-/cron-1.3.0.tgz",
"integrity": "sha512-K/SF7JlgMmNjcThWxkKvsHhey2EDB4CeOEWJ9aXWj3fbQJppsvTPIeyLdHfNq5IbbsMUUjRW1nr5dSO95f2E4w==",
"requires": {
"moment-timezone": "0.5.14"
}
},
"depd": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz",
@ -72,7 +80,7 @@
"discord.js": {
"version": "11.2.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.2.0.tgz",
"integrity": "sha512-IqJoACKH7hGXuewvNHvaeWmdetAU8IRHkfTTmRbihOQkwzaRaJdaGWDcUXQIswEEFX40W8B6w7rhO2xSEB3W+w==",
"integrity": "sha1-qt3iuGtpuQUWa4O8Sc/ENSOOGus=",
"requires": {
"long": "3.2.0",
"prism-media": "0.0.1",
@ -123,12 +131,6 @@
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
},
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
"optional": true
},
"immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
@ -153,14 +155,6 @@
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
},
"jsonfile": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz",
"integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=",
"requires": {
"graceful-fs": "4.1.11"
}
},
"jstransform": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/jstransform/-/jstransform-3.0.0.tgz",
@ -222,6 +216,19 @@
"minimist": "0.0.8"
}
},
"moment": {
"version": "2.19.3",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.19.3.tgz",
"integrity": "sha1-vbmdJw1tf9p4zA+6zoVeJ/59pp8="
},
"moment-timezone": {
"version": "0.5.14",
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.14.tgz",
"integrity": "sha1-TrOP+VOLgBCLpGekWPPtQmjM/LE=",
"requires": {
"moment": "2.19.3"
}
},
"mongodb": {
"version": "2.0.42",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.0.42.tgz",
@ -269,7 +276,7 @@
"parent-package-json": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/parent-package-json/-/parent-package-json-2.0.1.tgz",
"integrity": "sha512-dyHr5bP6k8vNT6oP0i4qsfD/rtUiSruJdv+I/BPr7rRtzYRnCu0v1qcM5yHmubobtvGX38SGe1XF2LBo1fN/xg=="
"integrity": "sha1-SbVUqeLcyu1F1+GiXqjOyde7axI="
},
"prism-media": {
"version": "0.0.1",
@ -324,7 +331,7 @@
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
"integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM="
},
"simple-file-writer": {
"version": "2.0.0",

1
discord-bot-core/package.json

@ -3,6 +3,7 @@
"main": "index.js",
"dependencies": {
"camo": "0.12.3",
"cron": "1.3.0",
"discord.js": "11.2.0",
"nedb": "1.8.0",
"parent-package-json": "2.0.1",

Loading…
Cancel
Save