├── .DS_Store ├── .env ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── assets └── guildsettings.sqlite ├── commands ├── ban.js ├── bugreport.js ├── changelog.js ├── devhelp.js ├── eval.js ├── giverole.js ├── help.js ├── hug.js ├── info.js ├── kick.js ├── kill.js ├── lockdown.js ├── logs.js ├── meme.js ├── mock.js ├── ping.js ├── purge.js ├── serverinfo.js ├── shutdown.js ├── tempmute.js ├── unban.js ├── userinfo.js ├── warn.js └── warnlvl.js ├── events ├── disconnect.js ├── error.js ├── message.js ├── ready.js └── reconnecting.js ├── hugged.json ├── index.js ├── killed.json ├── lounge.csv ├── loungeTH.csv ├── package-lock.json ├── package.json ├── procfile ├── scores copy.sqlite ├── thLogs.sqlite ├── treeLogs.sqlite ├── util └── eventLoader.js ├── wallpaper.png └── warnings.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cluzier/treehouse-bot/2065a0127fdd149b290bff3710215e885d9a96d0/.DS_Store -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | BOT_TOKEN=NTk1ODAwNjY4NzQ1NDk4NjU2.XRwR_A.P9fmhSUwyCgO57TrQuVdnPWVQdU -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | n.json 3 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at . All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Conner Luzier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # treehouse-bot 2 | 3 | ![GitHub issues](https://img.shields.io/github/issues/cluzier/treehouse-bot) 4 | ![Github forks](https://img.shields.io/github/forks/cluzier/treehouse-bot) 5 | ![Github stars](https://img.shields.io/github/stars/cluzier/treehouse-bot) 6 | ![Github license](https://img.shields.io/github/license/cluzier/treehouse-bot) 7 | [![HitCount](http://hits.dwyl.io/cluzier/treehouse-bot.svg)](http://hits.dwyl.io/cluzier/treehouse-bot) 8 | 9 | ## About 10 | 11 | A discord bot made for the Treehouse Server, it's main functionalities include: 12 | ``` 13 | * Ban 14 | * Kick 15 | * Lockdown 16 | * Warn 17 | * Mute 18 | ``` 19 | These are only a few of the commands. 20 | 21 | ## Installation 22 | 23 | Do in order: 24 | 25 | `$ git clone https://github.com/cluzier/treehouse-bot` 26 | 27 | `cd treehouse-bot` 28 | 29 | `npm i` 30 | 31 | Create a file `n.json` in root directory, copy and paste the below code into it and save, 32 | 33 | ``` 34 | { 35 | "name": "Treehouse-bot", 36 | "token": "bot token here", 37 | "oID": "owner id", 38 | "prefix": ">", 39 | "version": "1.0.3", 40 | "log_channel": "change this to your mod-logs channel" 41 | } 42 | ``` 43 | 44 | `node index.js` 45 | 46 | ## Contribute 47 | 48 | Clone and mix up things. If you think your edits are interesting for the public, just open a new pull request on that. 49 | 50 | ## Folder Structure 51 | 52 | ``` 53 | treehouse-bot 54 | ├─── assets 55 | │ └─── guildsettings.sqlite 56 | │ 57 | ├─── commands # Houses commands 58 | │ ├── ban.js 59 | │ ├── bugreport.js 60 | │ ├── devhelp.js 61 | │ ├── eval.js 62 | │ ├── giverole.js 63 | │ ├── help.js 64 | │ ├── hug.js 65 | │ ├── info.js 66 | │ ├── kick.js 67 | │ ├── kill.js 68 | │ ├── lockdown.js 69 | │ ├── meme.js 70 | │ ├── mock.js 71 | │ ├── ping.js 72 | │ ├── purge.js 73 | │ ├── serverinfo.js 74 | │ ├── shutdown.js 75 | │ ├── tempmute.js 76 | │ ├── unban.js 77 | │ ├── userinfo.js 78 | │ ├── warn.js 79 | │ └── warnlvl.js 80 | │ 81 | ├─── events 82 | │ ├── disconnect.js 83 | │ ├── error.js 84 | │ ├── message.js 85 | │ ├── ready.js 86 | │ └── reconnecting.js 87 | │ 88 | ├─── util 89 | │ └── eventLoader.js 90 | │ 91 | ├─── .DS_Store 92 | ├─── .env 93 | ├─── .gitignore 94 | ├─── CODE_OF_CONDUCT.md 95 | ├─── LICENSE 96 | ├─── 97 | ├─── hugged.json 98 | ├─── index.js 99 | ├─── killed.json 100 | ├─── package.json 101 | ├─── package-lock.json 102 | ├─── procfile 103 | ├─── README.md 104 | ├─── wallpaper.png 105 | └─── warnings.json 106 | ``` 107 | 108 | ## Required tools for development: 109 | 110 | * NodeJS 111 | 112 | * NPM 113 | 114 | ## Credits 115 | 116 | A project by [Conner Luzier](https://github.com/cluzier). 117 | Other amazing contributors [here](https://github.com/cluzier/treehouse-bot/graphs/contributors). 118 | -------------------------------------------------------------------------------- /assets/guildsettings.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cluzier/treehouse-bot/2065a0127fdd149b290bff3710215e885d9a96d0/assets/guildsettings.sqlite -------------------------------------------------------------------------------- /commands/ban.js: -------------------------------------------------------------------------------- 1 | const n = require("../n.json"); 2 | const Discord = require("discord.js"); 3 | const human = require('humanize'); 4 | exports.run = (client, message, args) => { 5 | if (message.author.bot) return; 6 | if (!message.guild) return; 7 | if (!message.member.hasPermission("BAN_MEMBERS") || message.author.id !== n.oID) { 8 | message.channel.send("You are missing the permission(s): Ban Members."); 9 | } else { 10 | let time = new Date(); 11 | function amPm() { 12 | if (time.getHours() >= 11) { 13 | return "PM"; 14 | } else return "AM"; 15 | } 16 | var testCont = message.content.split(" "); 17 | var content = message.content.split(" ").slice(2).join(' '); 18 | var banned = message.mentions.users.first(); 19 | if (message.mentions.users.size < 1) { 20 | message.channel.send("You must provide a user to ban!"); 21 | } else if (testCont.length <= 2) { 22 | message.channel.send("Please provide a reason for the ban."); 23 | } else if (message.guild.member(banned).bannable) { 24 | client.users.get(banned.id).send(`You have been banned from ${message.guild.name} for: ${content} by ${message.author.username}`); 25 | message.guild.member(banned).ban().then(banned => { 26 | var embed = new Discord.RichEmbed() 27 | .setTitle("Ban") 28 | .setDescription(`Banned ${banned.displayName}.`) 29 | .setAuthor(message.author.username + "#" + message.author.discriminator, `${message.author.avatarURL}`) 30 | .addField("Time", 31 | `Ban occured at ${human.date('m-d-y | h:i:s', new Date())} ${amPm()}`) 32 | .addField("Moderator", 33 | `Ban administered by ${message.author.username}#${message.author.discriminator}`) 34 | .addField("Reason", 35 | `${content}`) 36 | .setColor("#ff0000") 37 | .setTimestamp() 38 | message.channel.send(embed); 39 | }); 40 | } else message.channel.send("I am unable to ban that member."); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /commands/bugreport.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | module.exports.run = async (bot, message, args) => { 3 | let bug = args.join(" ").slice(0); 4 | let user = message.author.username; 5 | let guild = message.guild.name; 6 | let channel = bot.channels.get("571873575179649034") 7 | let embed = new Discord.RichEmbed() 8 | .setTitle("Bug Report") 9 | .setThumbnail("https://images-ext-1.discordapp.net/external/nQoe_5zRdR6A5gsh2fevRbNvhoc5A2YIWP7zVdN5_NE/%3Fv%3D1/https/cdn.discordapp.com/emojis/435908220100280320.png?width=80&height=80") 10 | .addField("Bug", bug) 11 | .addField("Reported By", user) 12 | .addField("Reported in", guild) 13 | .setColor("#f49542") 14 | 15 | message.channel.send("**| Your bug has been reported in the official server. It will be reviewed so please be patient.**") 16 | channel.send(embed).then(i => i.react("⏳")) 17 | 18 | 19 | 20 | 21 | } 22 | module.exports.help = { 23 | name: "bugreport" 24 | } -------------------------------------------------------------------------------- /commands/changelog.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const bot = new Discord.Client(); 3 | exports.run = (client, message, args) => { 4 | const embed = new Discord.RichEmbed() 5 | .setAuthor(client.user.username, client.user.avatarURL) 6 | .setColor(0x00A2E8) 7 | .setTitle("Changelog v1.2.1") 8 | .addField("Changes", "- Added changelog command for people interested in knowing whats new") 9 | .setTimestamp() 10 | .setFooter(client.user.username, client.user.avatarURL); 11 | message.channel.send({embed}) 12 | } 13 | -------------------------------------------------------------------------------- /commands/devhelp.js: -------------------------------------------------------------------------------- 1 | const Discord = require('discord.js'); 2 | const n = require('../n.json'); 3 | exports.run = (client, message, args) => { 4 | function randomColor() { 5 | var colors = ["#00F5FF", "#7FFFD4", "#008B45", "#FFD700", "#FF8000", "#FF0000", "#7FFF00", "#00BFFF", " #000080", "#8A2BE2", "#FFB5C5", "#00FFF7", "#B120DF", "#DF2057", "#FFFFFF", "#B2FF00"]; 6 | var colorNum = Math.floor(Math.random()*colors.length); 7 | return colors[colorNum]; 8 | } 9 | const embed = new Discord.RichEmbed() 10 | .setAuthor(message.author.username + "#" + message.author.discriminator, `${message.author.avatarURL}`) 11 | .setThumbnail(`${client.user.avatarURL}`) 12 | .setTitle("Dev Help | Commands") 13 | .setDescription("Developer help for " + n.name) 14 | .setColor(randomColor()) 15 | .addField("eval", 16 | "Evaluates a message as JS code.") 17 | .addField("shutdown", 18 | "Shuts the bot down.") 19 | .setFooter("coded by gonzo#3813") 20 | .setTimestamp() 21 | message.channel.send(embed); 22 | }; 23 | -------------------------------------------------------------------------------- /commands/eval.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | 3 | module.exports.run = async (bot, message, args) => { 4 | let embed = new Discord.RichEmbed() 5 | .setTitle("Evaluation") 6 | .setDescription("Sorry, the `eval` command can only be executed by the Developer.") 7 | .setColor("#cdf785"); 8 | if(message.author.id !== '209802617096896512') return message.channel.send(embed); 9 | function clean(text) { 10 | if (typeof(text) === "string") 11 | return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203)); 12 | else 13 | return text; 14 | }try { 15 | const code = args.join(" "); 16 | let evaled = eval(code); 17 | let rawEvaled = evaled; 18 | if (typeof evaled !== "string") 19 | evaled = require("util").inspect(evaled); 20 | 21 | let embed = new Discord.RichEmbed() 22 | .setTitle(`Evaluated in ${Math.round(bot.ping)}ms`) 23 | .addField(":inbox_tray: Input", `\`\`\`js\n${code}\n\`\`\``) 24 | .addField(":outbox_tray: Output", `\`\`\`js\n${clean(evaled).replace(bot.token, "Are you retarded?")}\n\`\`\``) 25 | .addField('Type', `\`\`\`xl\n${(typeof rawEvaled).substr(0, 1).toUpperCase() + (typeof rawEvaled).substr(1)}\n\`\`\``) 26 | .setColor('GREEN'); 27 | message.channel.send({embed}); 28 | } catch (err) { 29 | 30 | message.channel.send(`\`ERROR\` \`\`\`js\n${clean(err)}\n\`\`\``); 31 | } 32 | } 33 | 34 | module.exports.help = { 35 | name: "eval" 36 | } -------------------------------------------------------------------------------- /commands/giverole.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | 3 | module.exports.run = async (bot, message, args) => { 4 | 5 | //!addrole <@user> 6 | if(args[0] == "help"){ 7 | let helpembxd = new Discord.RichEmbed() 8 | .setColor("#00ff00") 9 | .addField("Addrole Command", "Usage: !addrole <@user> ") 10 | 11 | message.channel.send(helpembxd); 12 | return; 13 | } 14 | 15 | let xdemb = new Discord.RichEmbed() 16 | .setColor("#00ff00") 17 | .setTitle(`Addrole command`) 18 | .addField("Description:", "Add role to member", true) 19 | .addField("Usage", "!addrole [user] [role]", true) 20 | .addField("Example", "!addrole @Odar Member") 21 | 22 | if(message.author.id !== '209802617096896512') return message.channel.send("You don't have premmsions to do that!"); 23 | let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]); 24 | if(!rMember) return message.channel.send(xdemb); 25 | 26 | let role = args.join(" ").slice(22); 27 | if(!role) return message.channel.send("Specify a role!"); 28 | let gRole = message.guild.roles.find(`name`, role); 29 | if(!gRole) return message.channel.send("Couldn't find that role."); 30 | 31 | if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role."); 32 | await(rMember.addRole(gRole.id)); 33 | 34 | await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`) 35 | 36 | message.delete(); 37 | 38 | } 39 | 40 | module.exports.help = { 41 | name: "addrole", 42 | description: 'Add role to someone', 43 | usage: 'addrole <@user> ' 44 | } -------------------------------------------------------------------------------- /commands/help.js: -------------------------------------------------------------------------------- 1 | var Discord = require("discord.js"); 2 | var client = new Discord.Client(); 3 | var pageMenu = require("@quantiom/pagemenu"); 4 | 5 | exports.run = (client, message, args) => { 6 | let pMenu = new pageMenu( 7 | message, 8 | [{ 9 | title: "Help | Commands", 10 | description: "Page 1", 11 | thumbnail: `${client.user.avatarURL}`, 12 | color: "66cdaa", // green 13 | fields: [{ 14 | name: "ping", 15 | value: "Returns latency and websocket ping.", 16 | inline: true 17 | }, 18 | { 19 | name: "info", 20 | value: "Returns info about the bot, including uptime and a user count.", 21 | inline: true 22 | }, 23 | { 24 | name: "help", 25 | value: "Returns information about bot commands.", 26 | inline: true 27 | }, 28 | { 29 | name: "bugreport", 30 | value: "Submit a bug report for review. Example: >bugreport (reason).", 31 | inline: true 32 | }, 33 | { 34 | name: "warn", 35 | value: "Warns a user.", 36 | inline: true 37 | } 38 | ] 39 | }, 40 | { 41 | title: "Help | Commands", 42 | description: "Page 2", 43 | thumbnail: `${client.user.avatarURL}`, 44 | color: "66cdaa", // green 45 | fields: [{ 46 | name: "warnlvl", 47 | value: "Check a user's warning level.", 48 | inline: true 49 | }, 50 | { 51 | name: "kick", 52 | value: "Kicks a user.", 53 | inline: true 54 | }, 55 | { 56 | name: "tempmute", 57 | value: "Mute a user for a specified amount of time.", 58 | inline: true 59 | }, 60 | { 61 | name: "ban", 62 | value: "Bans a user.", 63 | inline: true 64 | }, 65 | { 66 | name: "unban", 67 | value: "Unban a user.", 68 | inline: true 69 | } 70 | ] 71 | }, 72 | { 73 | title: "Help | Commands", 74 | description: "Page 3", 75 | thumbnail: `${client.user.avatarURL}`, 76 | color: "66cdaa", // green 77 | fields: [{ 78 | name: "serverinfo", 79 | value: "Displays info about the server.", 80 | inline: true 81 | }, 82 | { 83 | name: "userinfo", 84 | value: "Displays info about a user.", 85 | inline: true 86 | }, 87 | { 88 | name: "softban", 89 | value: "Softban a user, deleting messages from them for 7 days, then allowing them to immediately rejoin.", 90 | inline: true 91 | }, 92 | { 93 | name: "purge", 94 | value: "Deletes a specified amount of messages.", 95 | inline: true 96 | }, 97 | { 98 | name: "lockdown", 99 | value: "Lock a channel for a specified amount of time.", 100 | inline: true 101 | }, 102 | ] 103 | }, 104 | { 105 | title: "Help | Commands", 106 | description: "Page 4", 107 | thumbnail: `${client.user.avatarURL}`, 108 | color: "66cdaa", // green 109 | fields: [{ 110 | name: "kill", 111 | value: "Kill a user or yourself. Counts how many kills per user.", 112 | inline: true 113 | }, 114 | { 115 | name: "hug", 116 | value: "Hug a user, counts how many hugs per user.", 117 | inline: true 118 | }, 119 | { 120 | name: "meme", 121 | value: "Generates a ranom meme from /r/dankmemes.", 122 | inline: true 123 | }, 124 | { 125 | name: "pewds", 126 | value: "Generates a random meme from /r/pewdiepie.", 127 | inline: true 128 | } 129 | ] 130 | }, 131 | 132 | ], { 133 | duration: 60000, 134 | expireFunction: function (msg) { 135 | msg.delete(); 136 | } 137 | } 138 | ); 139 | 140 | pMenu.run(); 141 | }; -------------------------------------------------------------------------------- /commands/hug.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const fs = require('fs'); 3 | const hugs = require('../hugged.json'); 4 | 5 | exports.run = (client, message, args) => { 6 | const target = message.mentions.users.first(); 7 | 8 | if (!target) 9 | return message.channel.send(`Please tag someone to hug.`); 10 | 11 | const id = target.id; 12 | let hugCount = hugs[id]; 13 | 14 | if (!hugCount) { 15 | hugs[id] = 1; 16 | 17 | const emb = new Discord.RichEmbed() 18 | .setColor('#0099ff') 19 | .addField(`${message.author} hugged ${target.tag} 🤗`, `${target.tag} has been hugged for the first time!`, true) 20 | .setImage('https://i.imgur.com/UV1JK09.gif') 21 | 22 | message.channel.send(emb); 23 | 24 | } else { 25 | hugCount = (hugs[id] = hugs[id] + 1); 26 | 27 | const emb = new Discord.RichEmbed() 28 | .setColor('#0099ff') 29 | .addField(`${message.author} hugged ${target.tag} 🤗`, `${target.tag} has been hugged ${hugCount} times!`, true) 30 | .setImage('https://i.imgur.com/UV1JK09.gif') 31 | 32 | message.channel.send(emb); 33 | 34 | } 35 | 36 | // Update hugs file 37 | fs.writeFileSync( 38 | "./hugged.json", 39 | JSON.stringify(hugs), 40 | (err) => console.log(err) 41 | ); 42 | } -------------------------------------------------------------------------------- /commands/info.js: -------------------------------------------------------------------------------- 1 | const human = require('humanize'); 2 | const bytes = require('pretty-bytes'); 3 | const Discord = require('discord.js'); 4 | const n = require('../n.json'); 5 | 6 | exports.run = (client, message, args) => { 7 | if(message.author.bot) return; 8 | function msToTime(duration) { 9 | var milliseconds = parseInt((client.uptime%1000)/100), seconds = parseInt((client.uptime/1000)%60), minutes = parseInt((client.uptime/(1000*60))%60), hours = parseInt((client.uptime/(1000*60*60))%24), days = parseInt((client.uptime/(1000*60*60*24))%31); 10 | days = (days < 10) ? "0" + days : days; 11 | hours = (hours < 10) ? "0" + hours : hours; 12 | minutes = (minutes < 10) ? "0" + minutes : minutes; 13 | seconds = (seconds < 10) ? "0" + seconds : seconds; 14 | return days + ":" + hours + ":" + minutes + ":" + seconds + "." + milliseconds; 15 | } 16 | function randomColor() { 17 | var colors = ["#00F5FF", "#7FFFD4", "#008B45", "#FFD700", "#FF8000", "#FF0000", "#7FFF00", "#00BFFF", " #000080", "#8A2BE2", "#FFB5C5", "#00FFF7", "#B120DF", "#DF2057", "#FFFFFF", "#B2FF00"]; 18 | var colorNum = Math.floor(Math.random()*colors.length); 19 | return colors[colorNum]; 20 | } 21 | let time = new Date(); 22 | function amPm() { 23 | if (time.getHours() >= 11) { 24 | return "PM"; 25 | } else return "AM"; 26 | } 27 | var embed = new Discord.RichEmbed() 28 | .setTitle("Bot Information") 29 | .setDescription("Information for " + n.name) 30 | .setThumbnail(`${client.user.avatarURL}`) 31 | .setAuthor(message.author.username + "#" + message.author.discriminator, `${message.author.avatarURL}`) 32 | .setColor(randomColor()) 33 | .addField("Total Users Serving", 34 | client.users.size, true) 35 | .addField("Uptime", 36 | msToTime(), true) 37 | .addField("Ready At", 38 | `${human.date('m-d-y | h:i:s', client.readyAt)} ${amPm()}`, true) 39 | .addField("Memory Usage", 40 | `Using ${bytes(process.memoryUsage().rss)}`, true) 41 | .addField("Total Guilds Serving", 42 | `${client.guilds.size}`, true) 43 | .addField("Version", 44 | `${n.version}`) 45 | .setFooter("coded by gonzo#0001") 46 | .setTimestamp() 47 | message.channel.send(embed); 48 | }; 49 | -------------------------------------------------------------------------------- /commands/kick.js: -------------------------------------------------------------------------------- 1 | const n = require("../n.json"); 2 | const Discord = require("discord.js"); 3 | const human = require('humanize'); 4 | exports.run = (client, message, args) => { 5 | if (message.author.bot) return; 6 | if (!message.guild) return; 7 | if (!message.member.hasPermission("KICK_MEMBERS") || message.author.id !== n.oID) { 8 | message.channel.send("You are missing the permission(s): Kick Members."); 9 | } else { 10 | let time = new Date(); 11 | function amPm() { 12 | if (time.getHours() >= 11) { 13 | return "PM"; 14 | } else return "AM"; 15 | } 16 | var testCont = message.content.split(" "); 17 | var content = message.content.split(" ").slice(2).join(' '); 18 | var kicked = message.mentions.users.first(); 19 | if (message.mentions.users.size < 1) { 20 | message.channel.send("You must provide a user to kick!"); 21 | } else if (testCont.length <= 2) { 22 | message.channel.send("Please provide a reason for the kick."); 23 | } else if (message.guild.member(kicked).kickable) { 24 | client.users.get(kicked).send(`You have been kicked from ${message.guild.name} for: ${content} by ${message.author.username}`); 25 | message.guild.member(kicked).kick().then(kicked => { 26 | var embed = new Discord.RichEmbed() 27 | .setTitle("Kick") 28 | .setDescription(`Kicked ${kicked.displayName}.`) 29 | .setAuthor(message.author.username + "#" + message.author.discriminator, `${message.author.avatarURL}`) 30 | .addField("Time", 31 | `Kick occured at ${human.date('m-d-y | h:i:s', new Date())} ${amPm()}`) 32 | .addField("Moderator", 33 | `Kick administered by ${message.author.username}#${message.author.discriminator}`) 34 | .addField("Reason", 35 | `${content}`) 36 | .setColor("#ff0000") 37 | .setTimestamp() 38 | message.channel.send(embed); 39 | }); 40 | } else message.channel.send("I am unable to kick that member."); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /commands/kill.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const fs = require('fs'); 3 | const kills = require('../killed.json'); 4 | 5 | exports.run = (client, message, args) => { 6 | const target = message.mentions.users.first(); 7 | 8 | if (!target) 9 | return message.channel.send(`${message.author} killed themselves. 💀`); 10 | 11 | const id = target.id; 12 | let deathCount = kills[id]; 13 | 14 | if (!deathCount) { 15 | kills[id] = 1; 16 | 17 | const emb = new Discord.RichEmbed() 18 | .setColor('#0099ff') 19 | .addField(`${message.author} killed ${target.tag} 🔪`, `${target.tag} has been killed for the first time!`, true) 20 | .setImage('https://i.imgur.com/7MkzxTT.gif') 21 | 22 | message.channel.send(emb); 23 | 24 | } else { 25 | deathCount = (kills[id] = kills[id] + 1); 26 | 27 | const emb = new Discord.RichEmbed() 28 | .setColor('#0099ff') 29 | .addField(`${message.author} killed ${target.tag} 🔪`, `${target.tag} has been killed ${deathCount} times!`, true) 30 | .setImage('https://i.imgur.com/7MkzxTT.gif') 31 | 32 | message.channel.send(emb); 33 | 34 | } 35 | 36 | // Update kills file 37 | fs.writeFileSync( 38 | "./killed.json", 39 | JSON.stringify(kills), 40 | (err) => console.log(err) 41 | ); 42 | } -------------------------------------------------------------------------------- /commands/lockdown.js: -------------------------------------------------------------------------------- 1 | var Discord = require("discord.js"); 2 | const ms = require("ms"); 3 | exports.run = async (bot, message, args = []) => { 4 | 5 | if(message.member.hasPermission("MANAGE_GUILD")) { 6 | 7 | if (!bot.lockit) bot.lockit = []; 8 | 9 | let time = args.join(' ') 10 | let validUnlocks = ['release', 'unlock']; 11 | var notimeembed = new Discord.RichEmbed() 12 | .setTitle('Error') 13 | .setDescription("👾 You must set a duration for the lockdown in either hours, minutes or seconds") 14 | .setColor('36393e') 15 | if (!time) return message.channel.send(notimeembed); 16 | 17 | if (validUnlocks.includes(time)) { 18 | message.channel.overwritePermissions(message.guild.id, { 19 | SEND_MESSAGES: null 20 | }).then(() => { 21 | var liftedembed = new Discord.RichEmbed() 22 | .setTitle('🔒 Lockdown') 23 | .setDescription("🔓 Lockdown lifted.") 24 | .setColor('36393e') 25 | message.channel.send(liftedembed); 26 | clearTimeout(bot.lockit[message.channel.id]); 27 | delete bot.lockit[message.channel.id]; 28 | }).catch(error => { 29 | console.log(error); 30 | }); 31 | } else { 32 | message.channel.overwritePermissions(message.guild.id, { 33 | SEND_MESSAGES: false 34 | }).then(() => { 35 | var lockdownembed = new Discord.RichEmbed() 36 | .setTitle("🔒 Channel Locked") 37 | .addField("Locked by", `${message.author}`, true) 38 | .addField("Locked for", `${ms(ms(time), { long:true })}`, true) 39 | .setColor('36393e') 40 | message.channel.send(lockdownembed).then(() => { 41 | 42 | bot.lockit[message.channel.id] = setTimeout(() => { 43 | var liftedembed = new Discord.RichEmbed() 44 | .setTitle('🔒 Lockdown') 45 | .setDescription("🔓 Lockdown lifted.") 46 | .setColor('36393e') 47 | message.channel.overwritePermissions(message.guild.id, { 48 | SEND_MESSAGES: null 49 | }).then( 50 | 51 | message.channel.send(liftedembed)).catch(console.error); 52 | delete bot.lockit[message.channel.id]; 53 | }, ms(time)); 54 | 55 | }).catch(error => { 56 | console.log(error); 57 | }); 58 | }); 59 | } 60 | 61 | } else { 62 | var nopermsembed = new Discord.RichEmbed() 63 | .setTitle('Error') 64 | .setDescription("👾 Missing Permissions :: MANAGE_SERVER") 65 | .setColor('36393e') 66 | message.channel.send(nopermsembed) 67 | } 68 | 69 | 70 | 71 | 72 | }; 73 | 74 | exports.conf = { 75 | enabled: true, 76 | guildOnly: true, 77 | aliases: [""], 78 | permLevel: 0 79 | }; 80 | 81 | exports.help = { 82 | name: "lockdown", 83 | description: "locks the channel down", 84 | category: "administration", 85 | usage: " lockdown