Create test.js

This commit is contained in:
Carol Knieriem 2020-02-08 19:49:59 -05:00
parent cbdfe6f935
commit fa2f7b4e91
No known key found for this signature in database
GPG Key ID: 932EC6A6BAEE122B
1 changed files with 35 additions and 0 deletions

35
commands/test.js Normal file
View 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]"
};