Compare commits
7 Commits
help-updat
...
master
Author | SHA1 | Date |
---|---|---|
rhearmas | ee45cdc2ea | |
Bliss Knieriem | 24165e1d42 | |
criti | 4ddd0fa9d9 | |
Bliss Knieriem | ecd7cadf47 | |
carol | 202aacc4b0 | |
Carol Knieriem | 70d642b7fd | |
Carol Knieriem | fa2f7b4e91 |
|
@ -1,58 +0,0 @@
|
|||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017
|
||||
},
|
||||
"env": {
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"indent": [
|
||||
"error",
|
||||
2,
|
||||
{
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"quotes": [
|
||||
"warn",
|
||||
"double"
|
||||
],
|
||||
"semi": [
|
||||
"warn",
|
||||
"always"
|
||||
],
|
||||
"keyword-spacing": [
|
||||
"error", {
|
||||
"before": true,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"space-before-blocks": [
|
||||
"error", {
|
||||
"functions":"always",
|
||||
"keywords": "always",
|
||||
"classes": "always"
|
||||
}
|
||||
],
|
||||
"space-before-function-paren": [
|
||||
"error", {
|
||||
"anonymous": "never",
|
||||
"named": "never",
|
||||
"asyncArrow": "always"
|
||||
}
|
||||
],
|
||||
"prefer-const": [
|
||||
"error", {
|
||||
"destructuring": "any",
|
||||
"ignoreReadBeforeAssign": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -7,7 +7,6 @@ yarn-error.log*
|
|||
config.json
|
||||
config.js
|
||||
data/
|
||||
test.js
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
|
@ -60,4 +59,3 @@ typings/
|
|||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
|
|
54
README.md
54
README.md
|
@ -1,57 +1,23 @@
|
|||
<h1 align="center">Cardboard Box</h1>
|
||||
# Welcome
|
||||
|
||||
## Information
|
||||
|
||||
**Cardboard Box** is a [Discord](https://discordapp.com) bot for my [**Discord server**](https://discord.gg/4zJ8xqV) powered by [Discord.js](https://discord.js.org). It comes packaged with many utilities and fun stuff, and even some special moderation functions.
|
||||
|
||||
**This bot is not suitable for usage outside of my Discord server!** This repository is primarily for issue tracking and global management between my own devices. If you really, *really* want to run it yourself, read the sections below.
|
||||
**This bot is not suitable for usage outside of my Discord server!** This repository is primarily for issue tracking and global management between my own devices. If you really, _really_ want to run it yourself, read the sections below.
|
||||
|
||||
## Adding the bot to your guild
|
||||
### Adding the bot to your guild
|
||||
|
||||
Don't want to run the bot yourself? Simply use [this link](https://discordapp.com/oauth2/authorize/?permissions=8&scope=bot&client_id=618576806177538079) to invite it to your own guild. If you prefer to run it under your own bot name, read the section below.
|
||||
Don't want to run the bot yourself? Simply use [this link](https://discordapp.com/oauth2/authorize/?permissions=8&scope=bot&client_id=618576806177538079) to invite it to your own guild.
|
||||
|
||||
<h1 align="center">Running it yourself</h1>
|
||||
## Credits
|
||||
|
||||
If you're really wanting to use this bot yourself, let's go over what you need and how to install it.
|
||||
* [SharpBot, a selfbot for Discord](https://github.com/RayzrDev/SharpBot) was actually my source for most of these cool commands! Huge kudos to [RayzrDev](https://github.com/RayzrDev) for making a cool selfbot.
|
||||
* This was initially an edit to [GuideBot, the boilerplate example bot in Discord.js](https://github.com/AnIdiotsGuide/guidebot). It has some minor edits to the base code, but most of the basic stuff came from this very example bot.
|
||||
|
||||
## Requirements
|
||||
|
||||
- `git` command line. Install by clicking your operating system's name in this list:
|
||||
- [Windows](https://git-scm.com/download/win)
|
||||
- [Linux](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||
- [Macintosh](https://git-scm.com/download/mac)
|
||||
- `node` version [8.0.0 or higher](https://nodejs.org).
|
||||
- Your **Discord bot token.** Read the first section of [this page](https://anidiots.guide/getting-started/the-long-version.html) on how to snag it.
|
||||
- `Python`. Install it from [here](https://www.python.org/downloads).
|
||||
|
||||
## Installation
|
||||
|
||||
1. Head on over to your terminal (preferrably **Command Prompt**) and clone the repository.
|
||||
- If you want to clone to a specific folder, you have two options:
|
||||
- **`cd` into your desired folder.** For example, if you wanted to clone the repository into Documents, open the terminal normally and run `cd C:/Users/<user>/Documents`.
|
||||
- Open the terminal in a specific folder by doing **Shift-Rightclick => Open <Powershell/command terminal> here**.
|
||||
- After doing either of those steps, clone the repository by running `git clone https://github.com/rhearmas/cardboardbot.git` through your terminal.
|
||||
2. When `git` has finished, `cd` into the newly-created folder for the repository.
|
||||
3. Run `npm install`. This installs all the prerequisites for the bot through **Node package manager**, which is bundled with `node`.
|
||||
- If you get any errors about python or msibuild.exe or binding, read the requirements section again and make sure you've installed **everything**.
|
||||
4. Run `node setup.js` to get a configuration file added.
|
||||
|
||||
## Running the bot
|
||||
|
||||
Open your terminal and run `node index.js` inside the folder. Don't forget to `cd` into it if the folder isn't in places like your Desktop.
|
||||
|
||||
## Getting it to your server
|
||||
|
||||
Generate an OAuth link for your bot. Use [this delicious link](https://finitereality.github.io/permissions-calculator/?v=0) to get your link. It even has a calculator for permissions!
|
||||
|
||||
<h1 align="center">Credits</h1>
|
||||
|
||||
- [SharpBot, a selfbot for Discord](https://github.com/RayzrDev/SharpBot) was actually my source for most of these cool commands! Huge kudos to [RayzrDev](https://github.com/RayzrDev) for making a cool selfbot.
|
||||
|
||||
- This was initially an edit to [GuideBot, the boilerplate example bot in Discord.js](https://github.com/AnIdiotsGuide/guidebot). It has some minor edits to the base code, but most of the basic stuff came from this very example bot.
|
||||
|
||||
<h1 align="center">Join me</h1>
|
||||
## Join me
|
||||
|
||||
If you need a fun server to join, regardless of whether or not you're new to Discord, join now! If you've never used Discord before, don't fret! It only takes a few minutes to sign up and get started.
|
||||
|
||||
# https://discord.gg/4zJ8xqV
|
||||
## [https://discord.gg/4zJ8xqV](https://discord.gg/4zJ8xqV)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ exports.run = async (client, message, [action, key, ...value], level) => {
|
|||
|
||||
client.settings.set(message.guild.id, joinedValue, key);
|
||||
|
||||
message.reply(`${key} successfully edited to ${joinedValue}`);
|
||||
message.reply(`Key \`${key}\` has successfully been changed to \`${joinedValue}\`.`);
|
||||
} else
|
||||
|
||||
if (action === "del" || action === "reset") {
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
const got = require("got");
|
||||
|
||||
exports.run = async (client, message, args, level) => {
|
||||
const pgAmount = args[0] || 2;
|
||||
const out = await got(`https://loripsum.net/api/${pgAmount}/decorate/code`);
|
||||
|
||||
let final = out.body;
|
||||
final = final.then(
|
||||
.replace("<b>", "**")).then(
|
||||
.replace("</b>", "**")).then(
|
||||
.replace("<p>", "")).then(
|
||||
.replace(" </p>", "")).then(
|
||||
.replace("<i>", "_")).then(
|
||||
.replace("</i>", "_")).then(
|
||||
.replace("<mark>", "||").then(
|
||||
.replace("</mark>", "||").then(
|
||||
.replace("<pre>","```").then(
|
||||
.replace("</pre>","```");
|
||||
|
||||
message.channel.send(final);
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [],
|
||||
permLevel: "Bot Owner"
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: "test",
|
||||
category: "",
|
||||
description: "Sends randomly-generated Lorem Ipsum demo text.",
|
||||
usage: "test [paragraphCount:2]"
|
||||
};
|
|
@ -52,6 +52,6 @@ module.exports = async (client, message) => {
|
|||
message.flags.push(args.shift().slice(1));
|
||||
}
|
||||
|
||||
client.logger.cmd(`[CMD] ${client.config.permLevels.find(l => l.level === level).name} ${message.author.username} (${message.author.id}) ran command ${cmd.help.name}`);
|
||||
client.logger.cmd(`${client.config.permLevels.find(l => l.level === level).name} ${message.author.username} (${message.author.id}) ran ${cmd.help.name}`);
|
||||
cmd.run(client, message, args, level);
|
||||
};
|
||||
|
|
|
@ -48,7 +48,7 @@ module.exports = (client) => {
|
|||
}
|
||||
};
|
||||
|
||||
client.caseNumber = async (client, modlog) {
|
||||
client.caseNumber = async (client, modlog) => {
|
||||
const messages = await modlog.fetchMessages({limit:5});
|
||||
|
||||
const log = messages.filter(m => m.author.id === client.user.id &&
|
||||
|
|
|
@ -90,9 +90,9 @@
|
|||
}
|
||||
},
|
||||
"chownr": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
|
||||
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g=="
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"cli-cursor": {
|
||||
"version": "2.1.0",
|
||||
|
@ -137,12 +137,19 @@
|
|||
"requires": {
|
||||
"colors": ">= 0.6.0-1",
|
||||
"first": "0.0.x",
|
||||
"mime": ">=1.4.1",
|
||||
"mime": "1.2.x",
|
||||
"node_hash": "0.2.x",
|
||||
"optimist": "0.3.x",
|
||||
"prettyjson": "0.7.x",
|
||||
"simplecrawler": "0.0.x",
|
||||
"underscore": "1.4.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"mime": {
|
||||
"version": "1.2.11",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz",
|
||||
"integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA="
|
||||
}
|
||||
}
|
||||
},
|
||||
"create-error-class": {
|
||||
|
@ -269,11 +276,11 @@
|
|||
"integrity": "sha1-EpqTHr+B01BdhffAXHti0MTOag4="
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz",
|
||||
"integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==",
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz",
|
||||
"integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==",
|
||||
"requires": {
|
||||
"minipass": "^2.2.1"
|
||||
"minipass": "^2.6.0"
|
||||
}
|
||||
},
|
||||
"get-stream": {
|
||||
|
@ -386,9 +393,9 @@
|
|||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.14",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
|
||||
"integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw=="
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
|
||||
},
|
||||
"lodash.assignin": {
|
||||
"version": "4.2.0",
|
||||
|
@ -465,43 +472,39 @@
|
|||
"resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz",
|
||||
"integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw="
|
||||
},
|
||||
"mime": {
|
||||
"version": ">=1.4.1",
|
||||
"integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA="
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
|
||||
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.3.5",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
|
||||
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
|
||||
"integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz",
|
||||
"integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
|
||||
"integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
|
||||
"requires": {
|
||||
"minipass": "^2.2.1"
|
||||
"minipass": "^2.9.0"
|
||||
}
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"moment": {
|
||||
|
@ -716,13 +719,13 @@
|
|||
}
|
||||
},
|
||||
"tar": {
|
||||
"version": "4.4.10",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz",
|
||||
"integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==",
|
||||
"version": "4.4.13",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
|
||||
"integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
|
||||
"requires": {
|
||||
"chownr": "^1.1.1",
|
||||
"fs-minipass": "^1.2.5",
|
||||
"minipass": "^2.3.5",
|
||||
"minipass": "^2.8.6",
|
||||
"minizlib": "^1.2.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"safe-buffer": "^5.1.2",
|
||||
|
@ -803,9 +806,9 @@
|
|||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
|
||||
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A=="
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
13
package.json
13
package.json
|
@ -3,22 +3,18 @@
|
|||
"version": "1.0.0",
|
||||
"description": "Discord bot that manages everything at my discord server.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"postinstall": "node setup.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rhearmas/cardboardbot.git"
|
||||
"url": "git+https://gitdab.com/rhearmas/cardboardbox.git"
|
||||
},
|
||||
"author": "rhearmas <rhearmas@gmail.com> (http://rhearmas.carrd.co)",
|
||||
"bugs": {
|
||||
"url": "https://github.com/rhearmas/cardboardbot/issues"
|
||||
"url": "https://gitdab.com/rhearmas/cardboardbox/issues"
|
||||
},
|
||||
"homepage": "https://github.com/rhearmas/cardboardbot#readme",
|
||||
"homepage": "https://gitdab.com/rhearmas/cardboardbox#readme",
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^5.4.0",
|
||||
"chalk": "^2.4.2",
|
||||
|
@ -36,8 +32,5 @@
|
|||
"recrawl": "^2.0.0",
|
||||
"roll": "^1.2.0",
|
||||
"webdict": "^0.3.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://npm.pkg.github.com/"
|
||||
}
|
||||
}
|
||||
|
|
5
setup.js
5
setup.js
|
@ -42,7 +42,7 @@ let prompts = [
|
|||
];
|
||||
|
||||
(async function () {
|
||||
console.log("Setting Up Cardboard Bot Configuration...");
|
||||
console.log("Setting Up Cardboard Box Configuration...");
|
||||
await settings.defer;
|
||||
if (!settings.has("default")) {
|
||||
prompts = prompts.slice(1);
|
||||
|
@ -62,7 +62,6 @@ let prompts = [
|
|||
.replace("{{token}}", `"${answers.token}"`);
|
||||
|
||||
fs.writeFileSync("./config.js", baseConfig);
|
||||
console.log("REMEMBER TO NEVER SHARE YOUR TOKEN WITH ANYONE!");
|
||||
console.log("Configuration has been written, enjoy!");
|
||||
console.log("Configuration has been written, have fun!");
|
||||
await settings.close();
|
||||
}());
|
Loading…
Reference in New Issue