mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 23:05:04 +02:00
Prefix Command, new uses alias, changemymind quality
This commit is contained in:
@@ -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 |
@@ -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' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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>')}.
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "122.0.2",
|
||||
"version": "122.1.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user