From 5de6989c47cd40b800d46c9c02728292ef9782cc Mon Sep 17 00:00:00 2001 From: David Sevilla Martin Date: Wed, 8 Apr 2020 11:24:27 -0400 Subject: [PATCH] fix(discord: commands): data: don't spam, send in DMs --- lib/Discord/Commands/Data.js | 56 +++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/lib/Discord/Commands/Data.js b/lib/Discord/Commands/Data.js index 06a4947..8497899 100644 --- a/lib/Discord/Commands/Data.js +++ b/lib/Discord/Commands/Data.js @@ -7,35 +7,39 @@ class DataCommand extends Command { this.props.help = { name: 'data', description: "know what data is being stored and what it's used for", + usage: 'data', }; - - this.setConf({ - permLevel: 1, - }); } - run(msg, args) { - return msg.channel.send( - new this.embed() - .setTitle(`${this.bot.user.username} Data`) - .addField('Commands', [ - `${this.bot.user} collects messages of valid commands that are run and unexpected errors thrown by commands, along with the guild, channel & user's name.`, - '⮩ This data is stored in a private Discord channel for debugging & support purposes. It is not shared with outside services.', - ]) - .addField('Guilds & Channels', [ - `When you add ${this.bot.user} to a server, it creates guild & channel configurations for them. These configurations contain the guild's or channel's ID & name.`, - '⮩ This data is stored in a local database that no one but the owner has access to.', - ]) - .addField('Repositories', [ - 'Repository names are stored when you initialize a repository or organization. They are also stored when you set the `repo` configuration option for the issue & merge request commands.', - '⮩ This data is stored in the local database as well.', - '⮩ The repository names are only used to match incoming GitLab events & retrieve repository information through commands.', - '⮩ No other repository data is stored.' - ]) - .addField( - 'Removing My Data', - `You can delete the guild & channel ID & name that is stored in the database by either removing ${this.bot.user}'s permission to view the channel or kicking the bot.` - ) + run(msg) { + const embed = new this.embed() + .setTitle(`${this.bot.user.username} Data`) + .addField('Commands', [ + `${this.bot.user} collects messages of valid commands that are run and unexpected errors thrown by commands, along with the guild, channel & user's name.`, + '⮩ This data is stored in a private Discord channel for debugging & support purposes. It is not shared with outside services.', + ]) + .addField('Guilds & Channels', [ + `When you add ${this.bot.user} to a server, it creates guild & channel configurations for them. These configurations contain the guild's or channel's ID & name.`, + '⮩ This data is stored in a local database that no one but the owner has access to.', + ]) + .addField('Repositories', [ + 'Repository names are stored when you initialize a repository or organization. They are also stored when you set the `repo` configuration option for the issue & merge request commands.', + '⮩ This data is stored in the local database as well.', + '⮩ The repository names are only used to match incoming GitLab events & retrieve repository information through commands.', + '⮩ No other repository data is stored.', + ]) + .addField( + 'Removing My Data', + `You can delete the guild & channel ID & name that is stored in the database by either removing ${this.bot.user}'s permission to view the channel or kicking the bot.` + ); + + return msg.author.send(embed).then(() => + msg.channel.send({ + embed: { + title: 'Yappy, the GitLab Monitor', + description: '📬 Sent data information!', + }, + }) ); } }