Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- bot.on("ready", () => {
- console.log("ready");
- });
- /*roles:
- * admin: 259140225622605824
- * mod: 275635333004263424
- */
- bot.on("message", message => {
- if (message.content.startsWith(".prune")) {
- // console.log(message.guild.roles);
- if (message.author.id == 219567184089841664) { message.channel.send("hek u nik"); return; }
- if (message.member.roles.has("259140225622605824") || message.member.roles.has("275635333004263424")) {
- if (message.content.length > 7 && message.content.startsWith(".prune ")) {
- if (isNaN(parseInt(message.content.substring(7)))) {
- message.channel.send("`ERR: no # val found` | Usage: `.prune n` where n = messages to delete");
- } else {
- var delmsgs = parseInt(message.content.substring(7));
- if (delmsgs > 99 || delmsgs < 2) {
- message.channel.send("Cannot delete more than 99 msgs or less than 2 msgs.");
- } else {
- message.channel.fetchMessages({limit: (delmsgs+1)})
- .then(messages => {
- message.channel.send("Pruned "+delmsgs+" messages!");
- message.channel.bulkDelete(messages);
- })
- .catch(console.error);
- }
- }
- } else {
- message.channel.send("`ERR: improper arg format` | Usage: `.prune n` where n = messages to delete");
- }
- } else {
- message.channel.send("`ERR: Insufficient permissions to use this command` | Usage: `.prune n` where n = messages to delete");
- }
- }
- });
- bot.on("guildMemberAdd", member => {
- member.guild.channels.get("277511282574360577").send(`Welcome to the trans channel, <@${member.id}>! Make sure to mention a <@&275635333004263424> or <@&259140225622605824> that is online or wait for someone to help you. Once verified you will be able to gain access to the rest of the channels.
- To be verified please tell a staff member your gender and a preferred name if you want. Have fun and enjoy your stay here!
- **It may take a few hours for a moderator or admin to get back to you, as we often are sleeping, or eating, or something.**`);
- });
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement