Prefix Command, new uses alias, changemymind quality

This commit is contained in:
Dragon Fire
2020-11-29 09:28:02 -05:00
parent 3fd607086f
commit 9ba788345f
6 changed files with 33 additions and 9 deletions
+2 -1
View File
@@ -257,7 +257,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 564
Total: 565
### Utility:
@@ -273,6 +273,7 @@ Total: 564
* **leave:** Leaves the current voice channel.
* **options:** Responds with a list of server options.
* **ping:** Checks the bot's ping to the Discord server.
* **prefix:** Responds with the bot's command prefix.
* **report:** Reports something to the bot owner(s).
* **uses:** Responds with a command's usage stats.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

After

Width:  |  Height:  |  Size: 743 KiB

+7 -7
View File
@@ -50,16 +50,16 @@ module.exports = class ChangeMyMindCommand extends Command {
const ctx = canvas.getContext('2d');
ctx.textBaseline = 'top';
ctx.drawImage(base, 0, 0);
ctx.rotate(-6 * (Math.PI / 180));
ctx.font = '28px Noto';
let fontSize = 28;
while (ctx.measureText(text).width > 309) {
ctx.rotate(24 * (Math.PI / 180));
ctx.font = '35px Noto';
let fontSize = 35;
while (ctx.measureText(text).width > 506) {
fontSize--;
ctx.font = `${fontSize}px Noto`;
}
const lines = await wrapText(ctx, text, 206);
ctx.fillText(lines.join('\n'), 184, 253, 206);
ctx.rotate(6 * (Math.PI / 180));
const lines = await wrapText(ctx, text, 337);
ctx.fillText(lines.join('\n'), 142, 430, 337);
ctx.rotate(-24 * (Math.PI / 180));
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'change-my-mind.png' }] });
}
};
+22
View File
@@ -0,0 +1,22 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
module.exports = class PrefixCommand extends Command {
constructor(client) {
super(client, {
name: 'prefix',
group: 'util-public',
memberName: 'prefix',
description: 'Responds with the bot\'s command prefix.',
guarded: true
});
}
run(msg) {
const prefix = msg.guild ? msg.guild.commandPrefix : this.client.commandPrefix;
return msg.reply(stripIndents`
${prefix ? `The command prefix is \`\`${prefix}\`\`.` : 'There is no command prefix.'}
To run a command, use ${msg.anyUsage('<command>')}.
`);
}
};
+1
View File
@@ -4,6 +4,7 @@ module.exports = class UsesCommand extends Command {
constructor(client) {
super(client, {
name: 'uses',
aliases: ['command-uses', 'cmd-uses'],
group: 'util-public',
memberName: 'uses',
description: 'Responds with a command\'s usage stats.',
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "122.0.2",
"version": "122.1.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {