summaryrefslogtreecommitdiff
path: root/server/src/commands/animals
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/animals')
-rw-r--r--server/src/commands/animals/Bunny.ts36
-rw-r--r--server/src/commands/animals/Cat.ts36
-rw-r--r--server/src/commands/animals/Dog.ts36
-rw-r--r--server/src/commands/animals/Duck.ts36
-rw-r--r--server/src/commands/animals/Fox.ts36
-rw-r--r--server/src/commands/animals/Owl.ts36
6 files changed, 216 insertions, 0 deletions
diff --git a/server/src/commands/animals/Bunny.ts b/server/src/commands/animals/Bunny.ts
new file mode 100644
index 0000000..5325002
--- /dev/null
+++ b/server/src/commands/animals/Bunny.ts
@@ -0,0 +1,36 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+import Axios from 'axios';
+import { colour } from '../../Config';
+
+export default class BunnyAnimals extends Command {
+ public constructor() {
+ super('bunny', {
+ aliases: ['bunny'],
+ category: 'animals',
+ description: {
+ content: 'Gives you a random bunny!',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ clientPermissions: ['EMBED_LINKS']
+ });
+ }
+
+ public async exec(msg: Message): Promise<Message> {
+ const animal = await Axios.get(`https://api.bunnies.io/v2/loop/random/?media=gif,png`).catch(err => {
+ console.error(err);
+ msg.reply('Woops, there was an error with the (http://api.bunies.io/) API.');
+ });
+
+ const embed = this.client.util.embed()
+ .setColor(colour)
+ .setAuthor('bunnies.io')
+ //@ts-ignore
+ .setImage(animal.data.media.gif);
+ return msg.channel.send(embed);
+ }
+} \ No newline at end of file
diff --git a/server/src/commands/animals/Cat.ts b/server/src/commands/animals/Cat.ts
new file mode 100644
index 0000000..8c37d2c
--- /dev/null
+++ b/server/src/commands/animals/Cat.ts
@@ -0,0 +1,36 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+import Axios from 'axios';
+import { colour } from '../../Config';
+
+export default class CatAnimals extends Command {
+ public constructor() {
+ super('cat', {
+ aliases: ['cat'],
+ category: 'animals',
+ description: {
+ content: 'Gives you a random cat!',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ clientPermissions: ['EMBED_LINKS']
+ });
+ }
+
+ public async exec(msg: Message): Promise<Message> {
+ const animal = await Axios.get(`https://aws.random.cat/meow`).catch(err => {
+ console.error(err);
+ msg.reply('Woops, there was an error with the (http://random.cat/) API.');
+ });
+
+ const embed = this.client.util.embed()
+ .setColor(colour)
+ .setAuthor('bunnies.io', 'https://i.imgur.com/Ik0Gf0r.png', 'https://random.cat')
+ //@ts-ignore
+ .setImage(animal.data.file);
+ return msg.channel.send(embed);
+ }
+} \ No newline at end of file
diff --git a/server/src/commands/animals/Dog.ts b/server/src/commands/animals/Dog.ts
new file mode 100644
index 0000000..c44131e
--- /dev/null
+++ b/server/src/commands/animals/Dog.ts
@@ -0,0 +1,36 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+import Axios from 'axios';
+import { colour } from '../../Config';
+
+export default class DogAnimals extends Command {
+ public constructor() {
+ super('dog', {
+ aliases: ['dog'],
+ category: 'animals',
+ description: {
+ content: 'Gives you a random dog!',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ clientPermissions: ['EMBED_LINKS']
+ });
+ }
+
+ public async exec(msg: Message): Promise<Message> {
+ const animal = await Axios.get(`https://dog.ceo/api/breeds/image/random`).catch(err => {
+ console.error(err);
+ msg.reply('Woops, there was an error with the (http://dog.ceo/api) API.');
+ });
+
+ const embed = this.client.util.embed()
+ .setColor(colour)
+ .setAuthor('dog.ceo', 'https://dog.ceo/img/favicon.png', 'https://dog.ceo/dog-api/')
+ //@ts-ignore
+ .setImage(animal.data.message);
+ return msg.channel.send(embed);
+ }
+} \ No newline at end of file
diff --git a/server/src/commands/animals/Duck.ts b/server/src/commands/animals/Duck.ts
new file mode 100644
index 0000000..c1b75f9
--- /dev/null
+++ b/server/src/commands/animals/Duck.ts
@@ -0,0 +1,36 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+import Axios from 'axios';
+import { colour } from '../../Config';
+
+export default class DuckAnimals extends Command {
+ public constructor() {
+ super('duck', {
+ aliases: ['duck'],
+ category: 'animals',
+ description: {
+ content: 'Gives you a random duck!',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ clientPermissions: ['EMBED_LINKS']
+ });
+ }
+
+ public async exec(msg: Message): Promise<Message> {
+ const animal = await Axios.get(`https://random-d.uk/api/v1/random?type=gif`).catch(err => {
+ console.error(err);
+ msg.reply('Woops, there was an error with the (http://random-d.uk/api/) API.');
+ });
+
+ const embed = this.client.util.embed()
+ .setColor(colour)
+ .setAuthor('random-d.uk', 'https://random-d.uk/favicon.ico', 'https://random-d.uk')
+ //@ts-ignore
+ .setImage(animal.data.url);
+ return msg.channel.send(embed);
+ }
+} \ No newline at end of file
diff --git a/server/src/commands/animals/Fox.ts b/server/src/commands/animals/Fox.ts
new file mode 100644
index 0000000..fc887ef
--- /dev/null
+++ b/server/src/commands/animals/Fox.ts
@@ -0,0 +1,36 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+import Axios from 'axios';
+import { colour } from '../../Config';
+
+export default class FoxAnimals extends Command {
+ public constructor() {
+ super('fox', {
+ aliases: ['fox'],
+ category: 'animals',
+ description: {
+ content: 'Gives you a random fox!',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ clientPermissions: ['EMBED_LINKS']
+ });
+ }
+
+ public async exec(msg: Message): Promise<Message> {
+ const animal = await Axios.get(`https://randomfox.ca/floof/`).catch(err => {
+ console.error(err);
+ msg.reply('Woops, there was an error with the (http://randomfox.ca/floof/) API.');
+ });
+
+ const embed = this.client.util.embed()
+ .setColor(colour)
+ .setAuthor('randomfox.ca')
+ //@ts-ignore
+ .setImage(animal.data.image);
+ return msg.channel.send(embed);
+ }
+} \ No newline at end of file
diff --git a/server/src/commands/animals/Owl.ts b/server/src/commands/animals/Owl.ts
new file mode 100644
index 0000000..bec7a5b
--- /dev/null
+++ b/server/src/commands/animals/Owl.ts
@@ -0,0 +1,36 @@
+import { Command } from 'discord-akairo';
+import { Message } from 'discord.js';
+import Axios from 'axios';
+import { colour } from '../../Config';
+
+export default class OwlAnimals extends Command {
+ public constructor() {
+ super('owl', {
+ aliases: ['owl'],
+ category: 'animals',
+ description: {
+ content: 'Gives you a random owl!',
+ usage: '',
+ examples: [
+ ''
+ ]
+ },
+ ratelimit: 3,
+ clientPermissions: ['EMBED_LINKS']
+ });
+ }
+
+ public async exec(msg: Message): Promise<Message> {
+ const animal = await Axios.get(`http://pics.floofybot.moe/owl`).catch(err => {
+ console.error(err);
+ msg.reply('Woops, there was an error with the (http://pics.floofybot.moe/owl) API.');
+ });
+
+ const embed = this.client.util.embed()
+ .setColor(colour)
+ .setAuthor('pics.floofybot.moe/owl', 'http://pics.floofybot.moe/assets/favicon.svg', 'http://pics.floofybot.moe/')
+ //@ts-ignore
+ .setImage(animal.data.image);
+ return msg.channel.send(embed);
+ }
+} \ No newline at end of file