Browse Source

Housekeeping

shorten
benji7425 3 years ago
parent
commit
c92688c80a
  1. 2
      app/models/feed-data.js
  2. 1
      discord-bot-core/BaseGuildData.js
  3. 6
      discord-bot-core/Client.js
  4. 1
      discord-bot-core/Command.js
  5. 6
      discord-bot-core/HandleMessage.js
  6. 7
      discord-bot-core/Util.js

2
app/models/feed-data.js

@ -33,7 +33,6 @@ module.exports = class FeedData {
};
}
/**@param guild*/
updatePastPostedLinks(guild) {
const channel = guild.channels.get(this.channelID);
@ -52,7 +51,6 @@ module.exports = class FeedData {
});
}
/**@param guild */
fetchLatest(guild) {
Dns.resolve(Url.parse(this.url).host || "", err => {
if (err)

1
discord-bot-core/BaseGuildData.js

@ -1,5 +1,4 @@
module.exports = class BaseGuildData {
/**@param param */
constructor(id) {
this.id = id;
}

6
discord-bot-core/Client.js

@ -8,12 +8,6 @@ const HandleMessage = require("./HandleMessage.js");
const InternalConfig = require("./internal-config.json");
module.exports = class Client extends Discord.Client {
/**
* @param {*} token
* @param {*} dataFile
* @param {*} commandsDir
* @param {*} guildDataModel
*/
constructor(token, dataFile, commandsDir, guildDataModel) {
super();

1
discord-bot-core/Command.js

@ -1,5 +1,4 @@
module.exports = class Command {
/**@param param */
constructor({ name, description, syntax, admin, invoke }) {
this.name = name;
this.description = description;

6
discord-bot-core/HandleMessage.js

@ -54,12 +54,6 @@ function handleInternalCommand(message, split, commands, isMemberAdmin) {
}
}
/**
* Create a help embed for available commands
* @param {string} name name of the bot
* @param {*[]} commands commands array
* @param {boolean} userIsAdmin whether the user is admin
*/
function createHelpEmbed(name, commands, userIsAdmin) {
const commandsArr = Object.keys(commands).map(x => commands[x]).filter(x => userIsAdmin || !x.admin);

7
discord-bot-core/Util.js

@ -1,15 +1,10 @@
const Console = require("console");
const Discord = require("discord.js");
const SimpleFileWriter = require("simple-file-writer");
const logWriter = new SimpleFileWriter("./console.log");
const debugLogWriter = new SimpleFileWriter("./debug.log");
/**
* Returns a promise that the user will answer
* @param {TextChannel} textChannel discord.js TextChannel to ask the question in
* @param {GuildMember} member discord.js Member to ask the question to
* @param {string} question question to ask
*/
function ask(client, textChannel, member, question) {
//return a promise which will resolve once the user next sends a message in this textChannel
return new Promise((resolve, reject) => {

Loading…
Cancel
Save