sends message that gets edited as the process is done

This commit is contained in:
rhearmas 2019-12-11 10:45:17 -05:00
parent 515091ad06
commit 4730dcffea
2 changed files with 185 additions and 146 deletions

View file

@ -1,55 +1,61 @@
const Discord = require("discord.js");
exports.run = (client, message, args) => {
exports.run = async (client, message, args) => {
message.delete();
const output = await message.channel.send("Generating the landing. Reading arguments...");
guild = message.guild;
let chnl = guild.channels.find(c => c.name === 'landing');
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(`Landing channel set to <#${chnl}>.`);
} else {
output.edit(`Arguments provided are invalid or channel was not found; set landing channel to ${chnl}.`);
}
async function clearLanding() {
let fetched;
fetched = await chnl.fetchMessages();
await output.edit(`Clearing messages in ${chnl}.`);
chnl.bulkDelete(fetched);
await output.edit(`Messages cleared in ${chnl}.`);
}
clearLanding();
const intro = new Discord.RichEmbed()
.setTitle("Introduction")
.setColor(0x00AE86)
.setDescription(`Welcome to the official **${guild.name} Discord server**! This is a Discord server that I personally run for all my shenanigans. This is the channel where I explain rules and stuff and other stuff.`)
.setDescription(`Welcome to **${guild.name}**! This is a Discord server that I personally run for all my shenanigans. This is the channel where I explain rules and stuff and other stuff.`)
.addField("IMPORTANT DISCLAIMER:", "This list does not constitute the full list of rules. With that in mind, try to use common sense and good judgement for any action you're about to take at all times.")
.addField("Before we go further...","I don't care if you use profanity here, since Discord only allows users who are at least 13 years of age. If you have a problem with this, then this isn't the discord server for you.")
.setThumbnail(guild.iconURL);
const textrules = new Discord.RichEmbed()
.setTitle("Text Channel Rules")
.setColor(0x8E8E38)
.addField("1.) Use common sense.","This means that you shouldn't be a jerk to others and have read the loose disclaimer.")
.addField("2.) No raiding.","Nobody here endorses raiding. Raiding this server or trying to rally other users to help you raid this server or another server is not allowed.")
.addField("3.) Do not attempt to destroy the server.","This includes vandalizing non-spam channels with spam or playing excessively loud music.")
.addField("4.) No discrimination.","This includes disrespecting people because of personal factors such as gender, sexual orientation, mental disabilities, race, age, location of residence, or anything else of the like.")
.addField("5.) Threats towards others are not allowed.","Do not attempt to cause others to feel endangered in this server. We want to provide a safe space for everyone here, so don't ruin it.")
.addField("6.) Abide by Discord's global platform rules.","This means that you should take the time to read the [Discord Terms of Service](https://discordapp.com/terms) and [Community Guidelines](https://discordapp.com/guidelines).")
.addField("7.) Don't complain about your punishments.","They were given for a valid reason. ModMail exists just in case a staff member falsely punishes you.")
.addField("8.) Loopholes aren't a thing, so don't go looking for them.","Don't be a wise-ass and just follow the rules. Don't test your boundaries, being here is a priviledge, not a right.")
.addField("9.) Advertising outside of the advertisement channel is not permitted.","This includes third-party services (that are not related to this Discord) or anything you or others have created, regardless of permission granted. Advertising other Discord servers -- or advertising **anything** in your playing status or through unsolicited DMs -- is strictly forbidden.")
.addField("10.) Don't cause beef with other members.","Don't send hate to other people if you see them as a bad person. Tolerate everyone here, even if you despise them, and don't engage in arguments.")
.addField("11.) Do not humiliate other people.","Mentioning previous drama or other situations any person was involved in is included.")
.addField("12.) No excuses for punishment.","The rule nullification system exists for a valid reason. Staff don't care until someone complains. Don't use this system as a way to attempt to circumvent a punishment.")
.addField("13.) Don't abuse your power.","You have power, that's cool. It does not, however, give you a one-way pass to do whatever you want.")
.addField("14.) Absolutely no NSFW content.","Shocking or graphic content, animal cruelty, and gore are not allowed whatsoever. Breaking this rule will result in a permanent ban on sight.");
.addField("Use common sense.","This means that you shouldn't be a jerk to others and have read the loose disclaimer.")
.addField("No raiding.","Nobody here endorses raiding. Raiding this server or trying to rally other users to help you raid this server or another server is not allowed.")
.addField("Do not attempt to destroy the server.","This includes vandalizing non-spam channels with spam or playing excessively loud music.")
.addField("No discrimination.","This includes disrespecting people because of personal factors such as gender, sexual orientation, mental disabilities, race, age, location of residence, or anything else of the like.")
.addField("Threats towards others are not allowed.","Do not attempt to cause others to feel endangered in this server. We want to provide a safe space for everyone here, so don't ruin it.")
.addField("Abide by Discord's global platform rules.","This means that you should take the time to read the [Discord Terms of Service](https://discordapp.com/terms) and [Community Guidelines](https://discordapp.com/guidelines).")
.addField("Don't complain about your punishments.","They were given for a valid reason. ModMail exists just in case a staff member falsely punishes you.")
.addField("Loopholes aren't a thing, so don't go looking for them.","Don't be a wise-ass and just follow the rules. Don't test your boundaries, being here is a priviledge, not a right.")
.addField("Advertising outside of the advertisement channel is not permitted.","This includes third-party services (that are not related to this Discord) or anything you or others have created, regardless of permission granted. Advertising other Discord servers -- or advertising **anything** in your playing status or through unsolicited DMs -- is strictly forbidden.")
.addField("Don't cause beef with other members.","Don't send hate to other people if you see them as a bad person. Tolerate everyone here, even if you despise them, and don't engage in arguments.")
.addField("Do not humiliate other people.","Mentioning previous drama or other situations any person was involved in is included.")
.addField("No excuses for punishment.","The rule nullification system exists for a valid reason. Staff don't care until someone complains. Don't use this system as a way to attempt to circumvent a punishment.")
.addField("Absolutely no NSFW content.","Shocking or graphic content, animal cruelty, and gore are not allowed whatsoever. Breaking this rule will result in a permanent ban on sight.");
const voicerules = new Discord.RichEmbed()
.setTitle("Voice Channel Rules")
.setColor(0x388E8E)
.addField("1.) Most text rules apply in the voice chat.","Don't go crazy because of the channels being different.")
.addField("2.) No loud audio.","Playing loud and/or annoying audio through your microphone or music bots is not allowed.")
.addField("3.) Be responsible.","Everyone in the server holds the right to report users in the voice channels to have them muted as needed.")
.addField("4.) Use common sense.","You can't escape this rule. Please don't ignore it.")
.addField("5.) Limit the usage of voice changers.","Don't fake what you sound like. We prevent discrimination, you're fine.");
.addField("Most text rules apply in the voice chat.","Don't go crazy because of the channels being different.")
.addField("No loud audio.","Playing loud and/or annoying audio through your microphone or music bots is not allowed.")
.addField("Be responsible.","Everyone in the server holds the right to report users in the voice channels to have them muted as needed.")
.addField("Use common sense.","You can't escape this rule. Please don't ignore it.")
.addField("Limit the usage of voice changers.","Don't fake what you sound like. We prevent discrimination, you're fine.");
const punishmentsystem = new Discord.RichEmbed()
.setTitle("Punishment System")
.setColor(0xC67171)
@ -59,10 +65,9 @@ exports.run = (client, message, args) => {
const nullify = new Discord.RichEmbed()
.setTitle("Rule Nullification System")
.setColor(0xC5C1AA)
.setDescription("Self-explanatory information that this server has implemented. When a user breaks a rule, as long as everybody within the constituting area (voice/text channel, room, etcetera) is okay with that rule being broken, and/or is not reported, then essentially all rules broken are nullified until a complaining or reporting individual (or group of individuals) is present.")
.addField("HOWEVER...","This does NOT mean that you can break the rules first and ask questions later. Use this additional information at your own discretion, but if you misuse it or abuse it, the punishment is your own fault.")
.addBlankField()
.addField("Exceptions:","Discrimination and raiding are still not allowed. Plus, you must still abide by the Discord ToS and Community Guidelines.");
.setDescription("This is a system about how to actually be punished for breaking rules, and how to avoid it if what you want to do is somehow \"important\". This is **especially important** for staff members.")
.addField("The System","When a user breaks a rule, as long as everybody within the constituting area is okay with that rule being broken, then **most** rules *(Embed keyword, most)* broken are nullified until a complaining or reporting individual, or group of individuals, is present.")
.addField("HOWEVER...","This does NOT mean that you can break the rules first and ask questions later. Use this additional information at your own discretion, but if you misuse it or abuse it, the punishment is your own fault. By the way, you must still abide by the Discord ToS and Community Guidelines in order to be protected by this system.")
const annoying = new Discord.RichEmbed()
.setTitle("Annoying Role")
.setColor(0x9AFF9A)
@ -73,16 +78,31 @@ exports.run = (client, message, args) => {
.setTitle("Important Links")
.setColor(0x8E388E)
.addField("Discord Server Invite Link","Use [this invite](https://discord.gg/4zJ8xqV) to invite others.")
.addField("Member Survey","After being here for a while, feel free to fill out [this form](https://goo.gl/forms/Gwa62lcu4zC7B8992).");
.addField("Member Survey","After being here for a while, feel free to fill out [this form](https://goo.gl/forms/Gwa62lcu4zC7B8992).")
.addField("Carrd","Rhearmas has an official website that shows a lot of the stuff about her. [Click here](https://rhearmas.carrd.co) to take a look!");
chnl.send({embed: intro});
chnl.send({embed: textrules});
chnl.send({embed: voicerules});
chnl.send({embed: punishmentsystem});
chnl.send({embed: nullify});
chnl.send({embed: annoying});
chnl.send({embed: links});
setTimeout(function(){chnl.send("*If you can't copy the invite link, here's the raw URL: https://discord.gg/4zJ8xqV*")},5000);
async function sendLandingEmbeds() {
await output.edit("Sending intro... *(Embed 1/7)*");
await chnl.send({embed: intro});
await output.edit("Sending text rules... *(Embed 2/7)*");
await chnl.send({embed: textrules});
await output.edit("Sending voice rules... *(Embed 3/7)*");
await chnl.send({embed: voicerules});
await output.edit("Sending punishment system... *(Embed 4/7)*");
await chnl.send({embed: punishmentsystem});
await output.edit("Sending punishment nullification system... *(Embed 5/7)*");
await chnl.send({embed: nullify});
await output.edit("Sending Annoying role system... *(Embed 6/7)*");
await chnl.send({embed: annoying});
await output.edit("Sending punishment nullification system... *(Embed 7/7)*");
await chnl.send({embed: links});
await chnl.send("*If you can't copy the invite link, here's the raw URL: https://discord.gg/4zJ8xqV*");
await output.edit(`Landing has finished building in ${chnl}. This message will be removed in 5 seconds.`).then(output => {
output.delete(5000)
})
.catch(() => console.error("Error while deleting message."));
}
sendLandingEmbeds();
};
exports.conf = {

View file

@ -1,20 +1,27 @@
const Discord = require("discord.js");
exports.run = (client, message, args) => {
exports.run = async (client, message, args) => {
message.delete();
const output = await message.channel.send("Generating the staff information. Reading arguments...");
guild = message.guild;
let chnl = message.channel;
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(`Staff info channel set to <#${chnl}>.`);
} else {
output.edit(`Arguments provided are invalid or channel was not found; set staff info channel to the current channel, ${chnl}.`);
}
async function clearChannel() {
let fetched;
fetched = await chnl.fetchMessages();
await output.edit(`Clearing messages in ${chnl}.`);
chnl.bulkDelete(fetched);
await output.edit(`Messages cleared in ${chnl}.`);
}
clearChannel();
@ -25,15 +32,16 @@ exports.run = (client, message, args) => {
const rules = new Discord.RichEmbed()
.setTitle("Staff Rules")
.setColor(0x8E8E38)
.addField("1.) Follow all this server's rules in #info.","Just because you're higher in the member list hierchy, doesn't mean you suddenly have a one-way ticket to total entitlement to break the rules. Set the good example for the nonadmins.")
.addField("2.) Don't be a hypocrite.","Hypocrisy is so, *so* incredibly common, and without properly addressing this, absolute chaos may ensue. With that said, remember that you need to always give yourself a taste of your own medicine before giving it to others.")
.addField("3.) Giveaways must require permission from a Head Admin or above.","Yeah, giving stuff away is fun, but don't abuse it.")
.addField("4.) Don't ping people unless it's justified.","Tying to this main server's rules, don't ping someone unless you're actively in conversation with them. Only ping higher-ups if someone's doing something wrong or you need help on what to do in a situation.")
.addField("5.) Don't abuse your power.","You aren't Stalin or Hitler or anything. Don't pull a fast one and go on murder sprees in-game or mass ban waves.")
.addField("6.) Don't do stuff to certain people because you \"don't like them\".","We all have our distaste for someone, but a community consensus for which bans are justified and which ones aren't. Warning people for stupid reasons isn't the right thing to do.")
.addField("7.) Changing parts of the server without prior permission is not allowed.","This isn't your server, it's the community's. Be righteous with what you do. You will need evidence to prove that you were permitted to do such actions.")
.addField("8.) Breaking Discord Terms of Service results in immediate action.","The Terms of Service are an important part to Discord. If you are exhibited to have assumed any behavior, you will be suspended from your priviledges.")
.addField("9.) Your rank doesn't let you ruin lower users' lives.","Do not use your rank as a way to get other people's attention or make them uncomfortable, **especially when trying to groom them like a predator**.");
.addField("Follow all this server's rules in #info.","Just because you're higher in the member list hierchy, doesn't mean you suddenly have a one-way ticket to total entitlement to break the rules. Set the good example for the nonadmins.")
.addField("Don't be a hypocrite.","Hypocrisy is so, *so* incredibly common, and without properly addressing this, absolute chaos may ensue. With that said, remember that you need to always give yourself a taste of your own medicine before giving it to others.")
.addField("Giveaways must require permission from a Head Admin or above.","Yeah, giving stuff away is fun, but don't abuse it.")
.addField("Don't ping people unless it's justified.","Tying to this main server's rules, don't ping someone unless you're actively in conversation with them. Only ping higher-ups if someone's doing something wrong or you need help on what to do in a situation.")
.addField("Don't abuse your power.","You aren't Stalin or Hitler or anything. Don't pull a fast one and go on murder sprees in-game or mass ban waves.")
.addField("Don't do stuff to certain people because you \"don't like them\".","We all have our distaste for someone, but a community consensus for which bans are justified and which ones aren't. Warning people for stupid reasons isn't the right thing to do.")
.addField("Changing parts of the server without prior permission is not allowed.","This isn't your server, it's the community's. Be righteous with what you do. You will need evidence to prove that you were permitted to do such actions.")
.addField("Breaking Discord Terms of Service results in immediate action.","The Terms of Service are an important part to Discord. If you are exhibited to have assumed any behavior, you will be suspended from your priviledges.")
.addField("Your rank doesn't let you ruin lower users' lives.","Do not use your rank as a way to get other people's attention or make them uncomfortable, **especially when trying to groom them like a predator**.")
.addField("Please remember that the rule nullification system exists.","This system determines whether someone is warned or not. This also means that the nonadmins need to take on responsibility and talk to one of the staff members if something comes up.");
const botinfo = new Discord.RichEmbed()
.setTitle("Management Information")
.setColor(0x388E8E)
@ -46,12 +54,23 @@ exports.run = (client, message, args) => {
.setDescription("As with the nonadmins, we hold the right to punish you as we see fit. Don't test your boundaries, and for the love of god, **do not use `@everyone` without any context**. People who don't tolerate pings may either leave the discord or will mute it, effectively missing out on events.")
.addField("Don't be afraid to ask questions!","Other staff members are always ready to help if you hit a snag and need someone higher up in the user hierarchy to handle something, or if that one button doesn't work or that lever doesn't go down all the way.");
chnl.send("\`<BEGIN_TAPE>\`");
chnl.send({embed: intro});
chnl.send({embed: rules});
chnl.send({embed: botinfo});
chnl.send({embed: importantInfo});
setTimeout(function(){chnl.send("\`<END_TAPE>\`")},1000);
await output.edit("Sending beginning... *(1/6)*");
await chnl.send("\`<BEGIN_TAPE>\`");
await output.edit("Sending introduction... *(2/6)*");
await chnl.send({embed: intro});
await output.edit("Sending rules... *(3/6)*");
await chnl.send({embed: rules});
await output.edit("Sending bot usage... *(4/6)*");
await chnl.send({embed: botinfo});
await output.edit("Sending important information... *(5/6)*");
await chnl.send({embed: importantInfo});
await output.edit("Sending ending... *(6/6)*");
await chnl.send("\`<END_TAPE>\`");
await output.edit(`Staff information has finished building in ${chnl}. This message will be removed in 5 seconds.`).then(output => {
output.delete(5000)
})
.catch(() => console.error("Error while deleting message."));
};
exports.conf = {