Some music fixes, merge decode and encode into a single command

This commit is contained in:
Essem 2022-04-10 11:20:52 -05:00
parent c37a8a5fcf
commit dd7bd6b4cc
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
9 changed files with 55 additions and 38 deletions

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class WikihowCommand extends Command {
async run() {
await this.acknowledge();
if (!this.interaction.acknowledged) await this.acknowledge();
const request = await fetch("https://www.wikihow.com/api.php?action=query&generator=random&prop=imageinfo&format=json&iiprop=url&grnnamespace=6");
const json = await request.json();
const id = Object.keys(json.query.pages)[0];