Slash command preparations
This commit is contained in:
parent
a438fe26df
commit
f996180fa9
20 changed files with 136 additions and 34 deletions
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()),
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue