This commit is contained in:
2022-11-24 16:25:20 +01:00
parent a26fb2df12
commit def44d2774
8 changed files with 113 additions and 13 deletions

View File

@ -18,9 +18,6 @@ export async function getGuildSetting(guildID: string): Promise<GuildSetting> {
}
export function isPremiumActive(timestamp: Date | null): boolean {
console.log(timestamp);
if (timestamp === null) return false;
const now = Number(new Date());
const activeUntil = Number(timestamp);

View File

@ -1,6 +1,7 @@
import pack from "../../package.json";
import { EmbedBuilder } from "discord.js";
import client from "../client";
import { Color, Emoji } from "./design";
// const _coolColors = [0x054566];
@ -11,21 +12,21 @@ export default function getDefaultEmbed(): EmbedBuilder {
iconURL: client.user?.avatarURL() || undefined,
});
embed.setTimestamp(new Date());
embed.setColor(0x3682cc);
embed.setColor(Color.ANONYMOUS_GRAY);
return embed;
}
export function getSuccessEmbed(): EmbedBuilder {
const embed = getDefaultEmbed();
embed.setTitle("Success");
embed.setColor(0x32d122);
embed.setTitle(`${Emoji.CHAT_APPROVE} Success`);
embed.setColor(Color.SUCCESSFUL_GREEN);
return embed;
}
export function getFailedEmbed(): EmbedBuilder {
const embed = getDefaultEmbed();
embed.setTitle("Failed");
embed.setColor(0xD01B15);
embed.setTitle(`${Emoji.CHAT_DENY} Failed`);
embed.setColor(Color.STOPSIGN_RED);
return embed;
}

30
src/tools/design.ts Normal file
View File

@ -0,0 +1,30 @@
export enum Emoji {
DOUBLE_ARROW_RIGHT = "<:double_arrow_right:918922668936413267>",
SETTINGS = "<:settings:918912063970099232>",
TIME = "<:time:918913616743387156>",
DOCS = "<:docs:918917779283918899>",
MESSAGE = "<:message:918920872683786280>",
WAVING = "<:waving:918949572804505640>",
CHAT_APPROVE = "<:chat_approve:918910607317667860>",
CHAT_DENY = "<:chat_deny:918911411663544410>",
WARN = "<:warn:918914600181825556>",
INFORMATION = "<:information:918912973874028614>",
ERROR = "<:error:918915254447136841>",
SWITCH_ON = "<:switch_on:918915977662586892>",
SWITCH_OFF = "<:switch_off:918917065899925584>",
SWITCH_UNSET = "<:switch_unset:918917082807156796>",
SECURITY_CHALLENGE = "<:security_challenge:918919903405305946>",
SECURITY_CHALLENGE_SUCCESS = "<:security_challenge_success:918919918672576562>",
SECURITY_CHALLENGE_FAILED = "<:security_challenge_failed:918919932887064696>",
ASTROGD = "<:astrogd:918906741125697626>",
PREMIUM = "<:premium:918909591255908442>",
}
export enum Color {
PREMIUM_ORANGE = 0xFFC800,
SUCCESSFUL_GREEN = 0x77DE37,
STOPSIGN_RED = 0xDA2132,
WARNING_YELLOW = 0xF0E210,
INFORMING_BLUE = 0x2FAAE2,
ANONYMOUS_GRAY = 0x7B7B7B
}