From 014e18f72a699cb12830b19079314f1ed5ffa0c7 Mon Sep 17 00:00:00 2001 From: Lio Young Date: Thu, 21 Oct 2021 21:19:14 +0200 Subject: [PATCH] x --- index.ts | 18 +++++++++------- shard.ts | 7 ++++--- src/discord/commands/animals/bird.ts | 31 ++++++++++++++++++++++++++++ src/discord/commands/dev/testing.ts | 19 +++++++++++++++++ 4 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 src/discord/commands/animals/bird.ts create mode 100644 src/discord/commands/dev/testing.ts diff --git a/index.ts b/index.ts index 206ca57..4eba013 100644 --- a/index.ts +++ b/index.ts @@ -1,9 +1,10 @@ -import { Discord } from "./src/modules/eu/src/index" -import path from "path" -import config from "./src/utils/config" -import { Intents } from "./src/modules/eu/src/misc/imports" +import "./src/utils/patch" + // @ts-ignore -import modulus from "./src/utils/modulus" +import { Discord } from "@modules/eu/src/index" +import path from "path" +import config from "@utils/config" +import { Intents } from "@modules/eu/src/misc/imports" const Bot = new Discord.Client({ @@ -12,6 +13,9 @@ const Bot = new Discord.Client({ commands: path.join(__dirname, "src", "discord", "commands"), events: path.join(__dirname, "src", "discord", "events"), options: { - intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES] - } + intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES], + commandCategories: true, + debug: true + }, + }) \ No newline at end of file diff --git a/shard.ts b/shard.ts index 39139b8..08ea5f2 100644 --- a/shard.ts +++ b/shard.ts @@ -1,7 +1,8 @@ -require("module-alias/register") +import "./src/utils/patch" -import { Discord } from "./src/modules/eu/src/index" -import config from "./src/utils/config" + +import { Discord } from "@modules/eu/src/index" +import config from "@utils/config" let Sharder = new Discord.ShardingManager('./build/index.js', { diff --git a/src/discord/commands/animals/bird.ts b/src/discord/commands/animals/bird.ts new file mode 100644 index 0000000..6ae93a5 --- /dev/null +++ b/src/discord/commands/animals/bird.ts @@ -0,0 +1,31 @@ +import { Context } from "@utils/types" +import { Command } from "@modules/eu/src/index" +import request from "@utils/animals" +import { MessageEmbed } from "discord.js" + +export = class Bird extends Command { + constructor() { + super({ + name: "bird", + aliases: ["birb"], + description: "Sends a random bird image", + }) + + } + + async run(context: Context): Promise { + let { image, provider } = await request("bird") + // console.log({ image, provider }) + if (context.settings.embeds) { + let Embed = new MessageEmbed() + .setImage(image[0]) + .setFooter(`Thaldrin - Image provided by ${provider}`, "https://thaldrin.media/avatar.png") + .setColor("ORANGE") + + context.channel.send({ embeds: [Embed] }) + } + else { + context.channel.send(image[0]) + } + } +} diff --git a/src/discord/commands/dev/testing.ts b/src/discord/commands/dev/testing.ts new file mode 100644 index 0000000..8575229 --- /dev/null +++ b/src/discord/commands/dev/testing.ts @@ -0,0 +1,19 @@ +import { Context } from "@utils/types" +import { Command } from "@modules/eu/src/index" + +export = class TestingCommand extends Command { + constructor() { + super({ + name: "testing", + aliases: ["t"], + }) + // console.log(this) + } + + async run(context: Context): Promise { + // console.log(context) + // console.log(this.nsfw) + console.log("testing") + return "Generic command" + } +}