cardboardbox/commands/Channel Building/guidelines.js

98 lines
7.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const Discord = require("discord.js");
exports.run = async (client, message, args) => {
message.delete();
const output = await message.channel.send("Generating the Guidelines. Reading arguments...");
guild = message.guild;
let chnl = guild.channels.find(c => c.name === 'community-guidelines') || guild.channels.find(c => c.name === 'guidelines');
if(args[0]) {
chnl = args[0].substring("<#".length);
chnl = chnl.substring(chnl.length-1,0);
chnl = guild.channels.find(c => c.id === chnl);
output.edit(`Guidelines channel set to <#${chnl}>.`);
} else {
output.edit(`Arguments provided are invalid or channel was not found; set landing channel to ${chnl}.`);
}
async function clearGuidelinesChannel() {
let fetched;
fetched = await chnl.fetchMessages();
await output.edit(`Clearing messages in ${chnl}...`);
if(fetched) {
chnl.bulkDelete(fetched);
await output.edit(`Messages cleared in ${chnl}.`);
} else {
await output.edit(`No messages found in ${chnl}.`);
}
}
clearGuidelinesChannel();
const intro = new Discord.RichEmbed()
.setTitle("Discord Community Guidelines")
.setColor(0x2f3136)
.setDescription(`We created Discord to help people come together around games. It's been amazing to watch it grow into what it is today - a place where millions of diverse communities exist and people connect with old friends and new. We can't wait to see what's next.\n\nOur community guidelines are meant to explain what is and isnt allowed on Discord, and ensure that everyone has a good experience. If you come across a message that appears to break these rules, please report it to us. We may take a number of steps, including issuing a warning, removing the content, or removing the accounts and/or servers responsible.\n\nThe overwhelming majority of people use Discord responsibly, so these guidelines may seem obvious. Still, we want to be clear about the expectations for our users. Every user of Discord should feel like their voice can be heard, but not at the expense of someone else.`)
const interact = new Discord.RichEmbed()
.setTitle("Here are some rules for interacting with others:")
.setColor(0x2f3136)
.addField("Do not organize, participate in, or encourage harassment of others.","Disagreements happen and are normal, but continuous, repetitive, or severe negative comments may cross the line into harassment and are not okay.")
.addField("Do not organize, promote, or coordinate servers around hate speech.","Its unacceptable to attack a person or a community based on attributes such as their race, ethnicity, national origin, sex, gender, sexual orientation, religious affiliation, or disabilities.")
.addField("Do not make threats of violence or threaten to harm others.","This includes indirect threats, as well as sharing or threatening to share someones private personal information (also known as doxxing).")
.addField("Do not evade user blocks or server bans.","Do not send unwanted, repeated friend requests or messages, especially after theyve made it clear they dont want to talk to you anymore. Do not try to hide your identity in an attempt to contact someone who has blocked you, or otherwise circumvent the tools we have which enable users to protect themselves.")
.addField("Do not send others viruses or malware.","[Also, do not] attempt to phish others, or hack or DDoS them.")
const content = new Discord.RichEmbed()
.setTitle("Here are some rules for content on Discord:")
.setColor(0x2f3136)
.addField("You may not sexualize minors in any way.","This includes sharing content or links which depict minors in a pornographic, sexually suggestive, or violent manner, and includes illustrated or digitally altered pornography that depicts minors (such as lolicon, shotacon, or cub). We report illegal content to the [National Center for Missing and Exploited Children](https://www.missingkids.org/gethelpnow/cybertipline).")
.addField("You may not share sexually explicit content of other people without their consent.","In addition, you cannot share or promote sharing of non-consensual intimate imagery (also known as revenge porn) in an attempt to shame or degrade someone.")
.addField("You may not share content that glorifies or promotes suicide or self-harm.","This includes any encouragement to others to cut themselves, or embrace eating disorders such as anorexia or bulimia.")
.addField("You may not share images of sadistic gore or animal cruelty.","_ _")
.addField("You may not use Discord for the organization, promotion, or support of violent extremism.","_ _")
.addField("You may not operate a server that sells or facilitates the sales of prohibited or potentially dangerous goods.","This includes firearms, ammunition, drugs, and controlled substances.")
.addField("You may not promote, distribute, or provide access to content involving the hacking, cracking, or distribution of pirated software or stolen accounts.","This includes sharing or selling cheats or hacks that may negatively affect others in multiplayer games.")
.addField("In general, you should not promote, encourage or engage in any illegal behavior.","This is very likely to get you kicked off Discord, and may get you reported to law enforcement.");
const respect = new Discord.RichEmbed()
.setTitle("Finally, we ask that you respect Discord itself:")
.setColor(0x2f3136)
.addField("You may not sell your account or your server.","_ _")
.addField("You may not use self-bots or user-bots to access Discord.","_ _")
.addField("You may not share content that violates anyone's intellectual property or other rights.","_ _")
.addField("You may not spam Discord, especially our Customer Support and Trust & Safety teams.","Making false and malicious reports, sending multiple reports about the same issue, or asking a group of users to all report the same content may lead to action being taken on your account.");
const end = new Discord.RichEmbed()
.setTitle("Reporting users who break these Guidelines")
.setColor(0x2f3136)
.setDescription("If you see any activity that violates these guidelines, you can report it to us by filling out [this form](https://dis.gd/request).")
async function sendGuidelineEmbeds() {
await output.edit("Sending intro... *(Embed 1/5)*");
await chnl.send({embed: intro});
await output.edit("Sending interaction rules... *(Embed 2/5)*");
await chnl.send({embed: interact});
await output.edit("Sending content rules... *(Embed 3/5)*");
await chnl.send({embed: content});
await output.edit("Sending Discord's respect rules... *(Embed 4/5)*");
await chnl.send({embed: respect});
await output.edit("Sending ending... *(Embed 5/5)*");
await chnl.send({embed: end});
await output.edit(`Guidelines have been sent in ${chnl}. This message will be removed in 5 seconds.`).then(output => {
output.delete(5000)
})
.catch(() => { });
}
sendGuidelineEmbeds();
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Bot Owner"
};
exports.help = {
name: "guidelines",
category: "Channel Building",
description: "Builds the guidelines channel by purging the whole channel and sending embeds. Builds in first channel named **community-guidelines** _or_ **guidelines** if no arguments are provided.",
usage: "guidelines channel"
};