Skip to content
This repository has been archived by the owner on Jan 31, 2021. It is now read-only.

Commit

Permalink
Remove uneeded commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyissillyyy committed Mar 2, 2020
1 parent 6824a13 commit 301b9f9
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 267 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Rando Cardrissian is a Discord bot coded in JavaScript with
primary feature is Cards Against Humanity, but Apples to Apples is also
available.

## Commands (15)
## Commands (9)
### Games:

* **apples-to-apples:** Compete to see who can come up with the best card to match an adjective.
Expand All @@ -24,18 +24,12 @@ available.

### Other:

* **hi:** Hello.
* **lando:** Responds with a random image of Lando Calrissian.

### Util:

* **changelog:** Responds with the bot's latest 10 commits.
* **donate:** Responds with the bot's donation links.
* **eval:** Executes JavaScript code.
* **help:** Displays a list of available commands, or detailed information for a specific command.
* **info:** Responds with detailed bot information.
* **invite:** Responds with the bot's invite links.
* **ip:** Responds with the IP address the bot\'s server is running on.
* **ping:** Checks the bot's ping to the Discord server.

## Licensing
Expand Down
20 changes: 0 additions & 20 deletions commands/other/hi.js

This file was deleted.

31 changes: 0 additions & 31 deletions commands/util/changelog.js

This file was deleted.

19 changes: 0 additions & 19 deletions commands/util/donate.js

This file was deleted.

100 changes: 0 additions & 100 deletions commands/util/eval.js

This file was deleted.

14 changes: 9 additions & 5 deletions commands/util/info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Command } = require('discord-akairo');
const { MessageEmbed } = require('discord.js');
const { Command, version: akairoVersion } = require('discord-akairo');
const { MessageEmbed, version: djsVersion, Permissions } = require('discord.js');
const moment = require('moment');
require('moment-duration-format');
const { version, dependencies } = require('../../package');
Expand All @@ -16,20 +16,24 @@ module.exports = class InfoCommand extends Command {
});
}

exec(msg) {
async exec(msg) {
const invite = await this.client.generateInvite(Permissions.ALL);
const embed = new MessageEmbed()
.setColor(0x00AE86)
.setFooter('©2018-2020 dragonfire535#8081')
.addField('❯ Servers', this.client.guilds.cache.size, true)
.addField('❯ Shards', this.client.options.shardCount, true)
.addField('❯ Commands', this.handler.modules.size, true)
.addField('❯ Shards', this.client.options.shardCount, true)
.addField('❯ Home Server', INVITE ? `[Invite](${INVITE})` : 'None', true)
.addField('❯ Invite', `[Add Me](${invite})`, true)
.addField('❯ Source Code',
source ? `[Github](https://github.com/${RANDO_GITHUB_REPO_USERNAME}/${RANDO_GITHUB_REPO_NAME})` : 'N/A', true)
.addField('❯ Memory Usage', `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
.addField('❯ Uptime', moment.duration(this.client.uptime).format('d:hh:mm:ss'), true)
.addField('❯ Version', `v${version}`, true)
.addField('❯ Node Version', process.version, true)
.addField('❯ Node.js', process.version, true)
.addField('❯ Discord.js', `v${djsVersion}`, true)
.addField('❯ Akairo', `v${akairoVersion}`, true)
.addField('❯ Dependencies', this.parseDependencies(dependencies));
return msg.util.send({ embed });
}
Expand Down
23 changes: 0 additions & 23 deletions commands/util/invite.js

This file was deleted.

20 changes: 0 additions & 20 deletions commands/util/ip.js

This file was deleted.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rando-cardrissian",
"version": "6.5.2",
"version": "7.0.0",
"description": "Cards Against Humanity, but for Discord!",
"main": "Rando.js",
"scripts": {
Expand Down Expand Up @@ -32,17 +32,19 @@
"node": ">=12"
},
"dependencies": {
"bufferutil": "^4.0.1",
"common-tags": "^1.8.0",
"discord-akairo": "github:1Computer1/discord-akairo",
"discord.js": "github:discordjs/discord.js",
"discord-akairo": "^8.0.0-beta.8",
"discord.js": "^12.0.1",
"dotenv": "^8.2.0",
"moment": "^2.24.0",
"moment-duration-format": "^2.3.2",
"node-superfetch": "^0.1.10",
"utf-8-validate": "^5.0.2",
"winston": "^3.2.1"
},
"optionalDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-config-amber": "^2.0.1",
Expand Down
2 changes: 0 additions & 2 deletions structures/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { stripIndents } = require('common-tags');
const winston = require('winston');
const path = require('path');
const DeckManager = require('./DeckManager');
const CodeType = require('../types/code');

module.exports = class Client extends AkairoClient {
constructor(options) {
Expand Down Expand Up @@ -48,7 +47,6 @@ module.exports = class Client extends AkairoClient {

setup() {
this.commandHandler.loadAll();
this.commandHandler.resolver.addType('code', CodeType);
this.decks.register(path.join(__dirname, '..', 'assets', 'json', 'decks'));
}
};
21 changes: 0 additions & 21 deletions types/code.js

This file was deleted.

14 changes: 0 additions & 14 deletions util/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,11 @@ module.exports = class Util {
return arr;
}

static shorten(text, maxLen = 2000) {
return text.length > maxLen ? `${text.substr(0, maxLen - 3)}...` : text;
}

static removeFromArray(arr, value) {
return arr.splice(arr.indexOf(value), 1);
}

static firstUpperCase(text) {
return `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
}

static escapeRegex(str) {
return str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
}

static base64(text, mode = 'encode') {
if (mode === 'encode') return Buffer.from(text).toString('base64');
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8') || null;
throw new TypeError(`${mode} is not a supported base64 mode.`);
}
};

0 comments on commit 301b9f9

Please sign in to comment.