Slash command preparations

This commit is contained in:
Essem 2022-03-22 15:43:26 -05:00
parent a438fe26df
commit f996180fa9
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
20 changed files with 136 additions and 34 deletions

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class AncientCommand extends Command {
async run() {
this.client.sendChannelTyping(this.message.channel.id);
this.acknowledge();
const controller = new AbortController(); // eslint-disable-line no-undef
const timeout = setTimeout(() => {
controller.abort();

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class BirdCommand extends Command {
async run() {
this.client.sendChannelTyping(this.message.channel.id);
this.acknowledge();
const imageData = await fetch("http://shibe.online/api/birds");
const json = await imageData.json();
return {

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class CatCommand extends Command {
async run() {
this.client.sendChannelTyping(this.message.channel.id);
this.acknowledge();
const controller = new AbortController(); // eslint-disable-line no-undef
const timeout = setTimeout(() => {
controller.abort();

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class DogCommand extends Command {
async run() {
this.client.sendChannelTyping(this.message.channel.id);
this.acknowledge();
const imageData = await fetch("https://dog.ceo/api/breeds/image/random");
const json = await imageData.json();
return {

View file

@ -4,7 +4,7 @@ import Command from "../../classes/command.js";
class MCCommand extends Command {
async run() {
if (this.args.length === 0) return "You need to provide some text to generate a Minecraft achievement!";
this.client.sendChannelTyping(this.message.channel.id);
this.acknowledge();
const request = await fetch(`https://www.minecraftskinstealer.com/achievement/a.php?i=13&h=Achievement+get%21&t=${encodeURIComponent(this.args.join("+"))}`);
return {
file: Buffer.from(await request.arrayBuffer()),

View file

@ -3,7 +3,7 @@ import Command from "../../classes/command.js";
class WikihowCommand extends Command {
async run() {
this.client.sendChannelTyping(this.message.channel.id);
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];