Skip to content

Commit

Permalink
Moved some things away from namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Struck713 committed Feb 23, 2024
1 parent a7c8c51 commit b35aa09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/commands/misc/status.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SlashCommandBuilder } from "discord.js";
import { Command } from "../../lib/command";
import { Embeds } from "../../utils/embeds";
import { Style } from "../../utils/style";
import * as Style from "../../utils/style";
import Time from "../../utils/time";

const startup = Date.now();
Expand Down
3 changes: 2 additions & 1 deletion src/utils/embeds.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { EmbedBuilder } from "@discordjs/builders";
import { CacheType, CommandInteraction, Message } from "discord.js";
import { Style } from "./style";
import * as Style from "./style";

type SendEmbed = { send: (interaction: CommandInteraction<CacheType>) => Promise<Message<boolean>> };
type EmbedBuilderWithSend = EmbedBuilder & SendEmbed;

export namespace Embeds {

export const create = (): EmbedBuilderWithSend => {
// I don't know if this is cool or messy, I like it though
let embed = new EmbedBuilder()
.setColor(Style.Color.DEFAULT)
.setTimestamp()
Expand Down
18 changes: 8 additions & 10 deletions src/utils/style.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Colors } from "discord.js";

export namespace Style {
export namespace Color {
export const DEFAULT = Colors.Yellow;
export const ERROR = Colors.Red;
}

export const NAME = "BarbarianBot";
export const ENGINE_VERSION = "Barbarian v2";
export const VERSION = "2.0";
export const PROFILE_URL = "https://cdn.discordapp.com/avatars/937850544255545394/dfa825b8b7cb035ef2577d847c22326e?size=1024" // https://i.imgur.com/risXNrf.png
export namespace Color {
export const DEFAULT = Colors.Yellow;
export const ERROR = Colors.Red;
}

export const NAME = "BarbarianBot";
export const ENGINE_VERSION = "Barbarian v2";
export const VERSION = "2.0";
export const PROFILE_URL = "https://cdn.discordapp.com/avatars/937850544255545394/dfa825b8b7cb035ef2577d847c22326e?size=1024" // https://i.imgur.com/risXNrf.png

0 comments on commit b35aa09

Please sign in to comment.