Create test.js
This commit is contained in:
parent
cbdfe6f935
commit
fa2f7b4e91
1 changed files with 35 additions and 0 deletions
35
commands/test.js
Normal file
35
commands/test.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
const got = require("got");
|
||||
|
||||
exports.run = async (client, message, args, level) => {
|
||||
const pgAmount = args[0] || 2;
|
||||
const out = await got(`https://loripsum.net/api/${pgAmount}/decorate/code`);
|
||||
|
||||
let final = out.body;
|
||||
final = final.then(
|
||||
.replace("<b>", "**")).then(
|
||||
.replace("</b>", "**")).then(
|
||||
.replace("<p>", "")).then(
|
||||
.replace(" </p>", "")).then(
|
||||
.replace("<i>", "_")).then(
|
||||
.replace("</i>", "_")).then(
|
||||
.replace("<mark>", "||").then(
|
||||
.replace("</mark>", "||").then(
|
||||
.replace("<pre>","```").then(
|
||||
.replace("</pre>","```");
|
||||
|
||||
message.channel.send(final);
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [],
|
||||
permLevel: "Bot Owner"
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: "test",
|
||||
category: "",
|
||||
description: "Sends randomly-generated Lorem Ipsum demo text.",
|
||||
usage: "test [paragraphCount:2]"
|
||||
};
|
Loading…
Reference in a new issue