mrmBot-Matrix/commands/yoda.js

10 lines
No EOL
389 B
JavaScript

const fetch = require("node-fetch");
exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to translate to Yodish!`;
const request = await fetch(`https://yoda-api.appspot.com/api/v1/yodish?text=${args.join("%20")}`);
const json = await request.json();
return json.yodish;
};
exports.aliases = ["yodish"];