Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
New: Add a dedicated privacy command
Browse files Browse the repository at this point in the history
  • Loading branch information
jftanner committed Oct 29, 2020
1 parent 797aeae commit e5e2428
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 8 deletions.
12 changes: 9 additions & 3 deletions classes/Lobby.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,11 @@ class Lobby {
* @returns {module:"discord.js".MessageEmbed}
*/
async scheduleInfoPost(options = {}) {
// Get the guild command prefix for command hints.
const guildConfig = await GuildConfig.load(this.voiceChannel.guild.id);
const prefix = guildConfig.defaultPrefix;

// Get room info.
const roomInfo = this.room ? `**${this.room.code}** (${this.room.region})` : 'Not Listed';

// Get and categorize players.
Expand Down Expand Up @@ -744,11 +749,12 @@ class Lobby {
.setFooter(`Capture Status: ${this.automation}`);

if (spectators) {
const guildConfig = await GuildConfig.load(this.voiceChannel.guild.id);
const prefix = guildConfig.defaultPrefix;
embed.addField('Spectators', spectators);
embed.addField('Join the Game!', [
`Use \`${prefix} join [In-Game Name]\` to join! (_Without the brackets._)`
`Use \`${prefix} join [In-Game Name]\` to join! (_Without the brackets._)`,
'',
'If you join a lobby, **the bot will store some data about you**.',
`You can use \`${prefix} privacy\` to review our privacy policy first.`
].join('\n'));
}

Expand Down
7 changes: 6 additions & 1 deletion discord-bot/commands/000-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = new Command({
// Generate the examples.
// TODO Do this automatically from the command definitions.
const coreExamples = [
"Here's come examples of how you might use the commands above:",
`\`${prefix} start\`: Start a new lobby.`,
`\`${prefix} join\`: Join the current lobby using your previously-saved in-game name.`,
`\`${prefix} join Alice\`: Set your in-game name to "Alice" and join the current lobby.`
Expand All @@ -39,7 +40,7 @@ module.exports = new Command({
`\`${prefix} kill me @tanner\`: Mark yourself and @tanner as dead. (Must be a real at-mention)`,
`\`${prefix} config set prefix !sau !s\`: Set the command prefix in this server to accept "!sau" or "!s"`
];
const examples = (displayMore ? moreExamples : coreExamples).map(example => `\t- ${example}`).join('\n');
const examples = (displayMore ? moreExamples : coreExamples).join('\n\t- ');

// Generate the basic embed.
const embed = new MessageEmbed()
Expand All @@ -63,6 +64,10 @@ module.exports = new Command({
embed.addField('Get More Help', `Use \`${prefix} ${alias} more\` for all the commands.`);
}

// Add privacy information.
const privacy = `Use \`${prefix} privacy\` to review our privacy policy and related commands.`;
embed.addField('Privacy & Data Security', privacy);

return message.channel.send(embed);
}
});
Expand Down
42 changes: 42 additions & 0 deletions discord-bot/commands/220-privacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const Command = require('.');
const { MessageEmbed } = require('discord.js');

module.exports = new Command({
aliases: ['privacy'],
description: "Review our privacy policy and related commands.",
category: 'privacy',
handler: async function () {
// Load properties from the command context.
const { message } = this;

// Set the description.
const description = [
"We take your privacy and data seriously!",
"\nHere's the short version:",
"- We'll never collect your real name or email address.",
"- We only store the data we actually need to support the bot's features.",
"- You can see what data we've collected at any time with the `show-me` command.",
"- We'll never sell your information. To anyone. Ever.",
"\nYou can read our [privacy statement](https://github.com/tanndev/silence-among-us#privacy) for details."
].join('\n');

const disclaimer = [
"This privacy policy _only_ applies to the **official** Tanndev-hosted bot instances.",
"If this instance is hosted by somebody else, they may not necessarily follow the same guidelines."
].join('\n');

const commands = [require('./221-show-me'), require('./222-forget-me')]
.map(command => `\t- ${command.toHelpText()}`)
.join('\n');

// Generate the basic embed.
const embed = new MessageEmbed()
.setTitle("Silence Among Us - Privacy")
.setURL('https://github.com/tanndev/silence-among-us#privacy')
.setDescription(description)
.addField('Related Commands', commands)
.addField('Disclaimer', disclaimer);

return message.channel.send(embed);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const UserConfig = require('../../classes/UserConfig');

module.exports = new Command({
aliases: ['show-me'],
description: 'Get a copy of all information the bot has about you',
category: 'more',
description: 'Get a copy of all information the bot has about you.',
handler: async function () {
// Load properties from the command context.
const { message } = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const UserConfig = require('../../classes/UserConfig');

module.exports = new Command({
aliases: ['forget-me'],
description: 'Erase all information the bot knows about you',
category: 'more',
description: 'Erase all information the bot knows about you.',
handler: async function () {
// Load properties from the command context.
const { message } = this;
Expand Down

0 comments on commit e5e2428

Please sign in to comment.