mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
URL Decode Command
This commit is contained in:
@@ -53,7 +53,7 @@ Xiao is a Discord bot coded in JavaScript with
|
|||||||
6. Run `npm i -g pm2` to install PM2.
|
6. Run `npm i -g pm2` to install PM2.
|
||||||
7. Run `pm2 start Xiao.js --name xiao` to run the bot.
|
7. Run `pm2 start Xiao.js --name xiao` to run the bot.
|
||||||
|
|
||||||
## Commands (342)
|
## Commands (343)
|
||||||
### Utility:
|
### Utility:
|
||||||
|
|
||||||
* **eval:** Executes JavaScript code.
|
* **eval:** Executes JavaScript code.
|
||||||
@@ -394,6 +394,7 @@ Xiao is a Discord bot coded in JavaScript with
|
|||||||
* **unspoiler:** Removes all spoilers from text.
|
* **unspoiler:** Removes all spoilers from text.
|
||||||
* **uppercase:** Converts text to uppercase.
|
* **uppercase:** Converts text to uppercase.
|
||||||
* **upside-down:** Flips text upside-down.
|
* **upside-down:** Flips text upside-down.
|
||||||
|
* **url-decode:** Decodes URL characters to regular characters.
|
||||||
* **url-encode:** Encodes text to URL-friendly characters.
|
* **url-encode:** Encodes text to URL-friendly characters.
|
||||||
* **webhook:** Posts a message to the webhook defined in the bot owner's `process.env`.
|
* **webhook:** Posts a message to the webhook defined in the bot owner's `process.env`.
|
||||||
* **yoda:** Converts text to Yoda speak.
|
* **yoda:** Converts text to Yoda speak.
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
|
||||||
|
module.exports = class URLDecodeCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'url-decode',
|
||||||
|
aliases: ['decode-url', 'decode-uri', 'uri-decode', 'decode-uri-component'],
|
||||||
|
group: 'text-edit',
|
||||||
|
memberName: 'url-decode',
|
||||||
|
description: 'Decodes URL characters to regular characters.',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'text',
|
||||||
|
prompt: 'What text would you like to decode?',
|
||||||
|
type: 'string',
|
||||||
|
validate: text => {
|
||||||
|
if (decodeURIComponent(text).length < 2000) return true;
|
||||||
|
return 'Invalid text, your text is too long.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run(msg, { text }) {
|
||||||
|
return msg.say(decodeURIComponent(text));
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "107.1.0",
|
"version": "107.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