mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
License Plate Command
This commit is contained in:
@@ -259,7 +259,7 @@ in the appropriate channel's topic to use it.
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Total: 571
|
Total: 572
|
||||||
|
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
@@ -661,6 +661,7 @@ Total: 571
|
|||||||
* **invert:** Draws an image or a user's avatar but inverted.
|
* **invert:** Draws an image or a user's avatar but inverted.
|
||||||
* **jeopardy-question:** Sends a Jeopardy Question with the text of your choice.
|
* **jeopardy-question:** Sends a Jeopardy Question with the text of your choice.
|
||||||
* **lego-icon:** Edits an image or avatar onto a character icon from LEGO Star Wars.
|
* **lego-icon:** Edits an image or avatar onto a character icon from LEGO Star Wars.
|
||||||
|
* **license-plate:** Creates a license plate with the text of your choice.
|
||||||
* **liquid-rescale:** Draws an image or a user's avatar but with liquid rescale from ImageMagick.
|
* **liquid-rescale:** Draws an image or a user's avatar but with liquid rescale from ImageMagick.
|
||||||
* **minecraft-skin:** Sends the Minecraft skin for a user.
|
* **minecraft-skin:** Sends the Minecraft skin for a user.
|
||||||
* **mirror:** Draws an image or a user's avatar but mirrored on the X/Y axis (or both).
|
* **mirror:** Draws an image or a user's avatar but mirrored on the X/Y axis (or both).
|
||||||
@@ -1062,6 +1063,8 @@ here.
|
|||||||
* danbooru (API)
|
* danbooru (API)
|
||||||
- [Dance Dance Revolution](https://www.ddrgame.com/)
|
- [Dance Dance Revolution](https://www.ddrgame.com/)
|
||||||
* emoji-emoji-revolution (Concept)
|
* emoji-emoji-revolution (Concept)
|
||||||
|
- [Dave Hansen](https://www.fontspace.com/dave-hansen)
|
||||||
|
* license-plate ([License Plate Font](https://www.fontspace.com/license-plate-font-f3359))
|
||||||
- [Deathbulge](http://deathbulge.com/comics)
|
- [Deathbulge](http://deathbulge.com/comics)
|
||||||
* ultimate-tattoo ([Image](http://deathbulge.com/comics/114))
|
* ultimate-tattoo ([Image](http://deathbulge.com/comics/114))
|
||||||
- [Demirramon](https://www.demirramon.com/)
|
- [Demirramon](https://www.demirramon.com/)
|
||||||
@@ -1533,6 +1536,8 @@ here.
|
|||||||
- [Perspective API](https://www.perspectiveapi.com/#/)
|
- [Perspective API](https://www.perspectiveapi.com/#/)
|
||||||
* severe-toxicity (API)
|
* severe-toxicity (API)
|
||||||
* toxicity (API)
|
* toxicity (API)
|
||||||
|
- [Pin Clipart](https://www.pinclipart.com/)
|
||||||
|
* license-plate ([Image](https://www.pinclipart.com/maxpin/bJxii/))
|
||||||
- [Platinum Designz](http://store.platinumdesignz.com/)
|
- [Platinum Designz](http://store.platinumdesignz.com/)
|
||||||
* glass-shatter ([Image](https://www.jing.fm/iclipt/u2q8u2a9o0t4i1q8/))
|
* glass-shatter ([Image](https://www.jing.fm/iclipt/u2q8u2a9o0t4i1q8/))
|
||||||
- [Playstation Trophies](https://www.playstationtrophies.org/)
|
- [Playstation Trophies](https://www.playstationtrophies.org/)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
@@ -0,0 +1,55 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const { createCanvas, loadImage, registerFont } = require('canvas');
|
||||||
|
const path = require('path');
|
||||||
|
const { wrapText } = require('../../util/Canvas');
|
||||||
|
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'LicensePlate.ttf'), { family: 'License Plate' });
|
||||||
|
|
||||||
|
module.exports = class LicensePlateCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'license-plate',
|
||||||
|
group: 'edit-image',
|
||||||
|
memberName: 'license-plate',
|
||||||
|
description: 'Creates a license plate with the text of your choice.',
|
||||||
|
throttling: {
|
||||||
|
usages: 1,
|
||||||
|
duration: 10
|
||||||
|
},
|
||||||
|
clientPermissions: ['ATTACH_FILES'],
|
||||||
|
credit: [
|
||||||
|
{
|
||||||
|
name: 'Dave Hansen',
|
||||||
|
url: 'https://www.fontspace.com/dave-hansen',
|
||||||
|
reason: 'License Plate Font',
|
||||||
|
reasonURL: 'https://www.fontspace.com/license-plate-font-f3359'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Pin Clipart',
|
||||||
|
url: 'https://www.pinclipart.com/',
|
||||||
|
reason: 'Image',
|
||||||
|
reasonURL: 'https://www.pinclipart.com/maxpin/bJxii/'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'text',
|
||||||
|
prompt: 'What text should the license plate say?',
|
||||||
|
type: 'string',
|
||||||
|
max: 10
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg, { text }) {
|
||||||
|
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'license-plate.png'));
|
||||||
|
const canvas = createCanvas(base.width, base.height);
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
ctx.drawImage(base, 0, 0);
|
||||||
|
ctx.textAlign = 'center';
|
||||||
|
ctx.textBaseline = 'middle';
|
||||||
|
ctx.font = '180px License Plate';
|
||||||
|
ctx.fillText(text.toUpperCase(), base.width / 2, base.height / 2, 700);
|
||||||
|
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'license-plate.png' }] });
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "124.1.0",
|
"version": "124.2.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user