Skip to content

Commit

Permalink
ref: adjusted messages deprecations and costants (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedStar071 committed Jul 15, 2024
2 parents 96b59f7 + 25cf1f1 commit 01cc429
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 72 deletions.
9 changes: 5 additions & 4 deletions src/commands/General/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export class UserCommand extends WolfCommand {
const url = this.getInvite();
const support = this.getSupportComponent(t);
const github = this.getGitHubComponent(t);
const donate = this.getDonateComponent(t);
// const donate = this.getDonateComponent(t);
const data = url
? [this.getActionRow(support, this.getInviteComponent(t, url)), this.getActionRow(github, donate)]
: [this.getActionRow(support, github, donate)];
? [this.getActionRow(support, this.getInviteComponent(t, url)), this.getActionRow(github /* , donate */)]
: [this.getActionRow(support, github /* , donate */)];

return data;
}
Expand Down Expand Up @@ -136,6 +136,7 @@ export class UserCommand extends WolfCommand {
};
}

/*
private getDonateComponent(t: TFunction): APIMessageActionRowComponent {
return {
type: ComponentType.Button,
Expand All @@ -145,7 +146,7 @@ export class UserCommand extends WolfCommand {
url: 'https://donate.wolfstar.rocks'
};
}

*/
private formatCpuInfo({ times }: CpuInfo) {
return `${Math.round(((times.user + times.nice + times.sys + times.irq) / times.idle) * 10000) / 100}%`;
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/General/v7-artiel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LanguageKeys } from '#lib/i18n/languageKeys';
import { WolfCommand } from '#lib/structures';
import { ButtonInviteArtiel, ButtonWolfV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate';
import { ButtonInviteArtiel, ButtonSkyraV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate';
import { ApplyOptions } from '@sapphire/decorators';
import { send } from '@sapphire/plugin-editable-commands';
import type { Message } from 'discord.js';
Expand Down Expand Up @@ -50,7 +50,7 @@ const list = createDeprecatedList({
]
});

const row = makeRow(ButtonInviteArtiel, ButtonWolfV7);
const row = makeRow(ButtonInviteArtiel, ButtonSkyraV7);

@ApplyOptions<WolfCommand.Options>({
name: '\u200Bv7-artiel',
Expand Down
10 changes: 5 additions & 5 deletions src/commands/General/v7.ts → src/commands/General/v7-skyra.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { LanguageKeys } from '#lib/i18n/languageKeys';
import { WolfCommand } from '#lib/structures';
import { ButtonWolfV7, makeRemovedMessage, makeRow } from '#utils/deprecate';
import { ButtonSkyraV7, makeRemovedMessage, makeRow } from '#utils/deprecate';
import { ApplyOptions } from '@sapphire/decorators';
import { send } from '@sapphire/plugin-editable-commands';
import type { Message } from 'discord.js';

const row = makeRow(ButtonWolfV7);
const row = makeRow(ButtonSkyraV7);

@ApplyOptions<WolfCommand.Options>({
name: '\u200Bv7',
name: '\u200Bv7-skyra',
aliases: ['ping', 'pong'],
description: LanguageKeys.Commands.General.V7Description,
detailedDescription: LanguageKeys.Commands.General.V7Extended,
description: LanguageKeys.Commands.General.V7SkyraDescription,
detailedDescription: LanguageKeys.Commands.General.V7SkyraExtended,
hidden: true
})
export class UserCommand extends WolfCommand {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/General/v7-teryl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LanguageKeys } from '#lib/i18n/languageKeys';
import { WolfCommand } from '#lib/structures';
import { ButtonInviteTeryl, ButtonWolfV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate';
import { ButtonInviteTeryl, ButtonSkyraV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate';
import { ApplyOptions } from '@sapphire/decorators';
import { send } from '@sapphire/plugin-editable-commands';
import type { Message } from 'discord.js';
Expand All @@ -9,7 +9,7 @@ const list = createDeprecatedList({
entries: [{ out: '</reminders create:1078828281949859985>', in: ['remindme', 'rmm', 'remind', 'reminder', 'reminders'] }]
});

const row = makeRow(ButtonInviteTeryl, ButtonWolfV7);
const row = makeRow(ButtonInviteTeryl, ButtonSkyraV7);

@ApplyOptions<WolfCommand.Options>({
name: '\u200Bv7-teryl',
Expand Down
4 changes: 2 additions & 2 deletions src/commands/Twitch/twitchsubscription.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { LanguageKeys } from '#lib/i18n/languageKeys';
import { WolfCommand, WolfSubcommand } from '#lib/structures';
import { PermissionLevels, type GuildMessage } from '#lib/types';
import { ButtonWolfV7, makeRemovedMessage, makeRow } from '#utils/deprecate';
import { ButtonWolfStarV7, makeRemovedMessage, makeRow } from '#utils/deprecate';
import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators';
import { CommandOptionsRunTypeEnum } from '@sapphire/framework';
import { send } from '@sapphire/plugin-editable-commands';
import { PermissionFlagsBits } from 'discord.js';

const row = makeRow(ButtonWolfV7);
const row = makeRow(ButtonWolfStarV7);

@ApplyOptions<WolfSubcommand.Options>({
aliases: ['twitch-subscription', 't-subscription', 't-sub'],
Expand Down
10 changes: 7 additions & 3 deletions src/languages/en-US/commands/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@
"helpNodm": "{{REDCROSS}} | You have DMs disabled so I couldn't send you the list of commands.",
"v7Description": "Gets the information regarding Skyra v7",
"v7Extended": {
"extendedHelp": "This is a **hidden** command used exclusively to send a notice to everyone who tries to use commands that have been removed according to [SKyra v7](https://skyra.notion.site/skyra/Skyra-v7-922ba06004654142a7b63347a92513a8) plans."
"extendedHelp": "This is a **hidden** command used exclusively to send a notice to everyone who tries to use commands that have been removed according to [WolfStar v7](https://wolfstar.notion.site/wolfstar) plans."
},
"v7Message": "Hello there! Thank you for using this command, however, it was removed due to [Skyra v7](https://skyra.notion.site/skyra/WolfStar-v7-922ba06004654142a7b63347a92513a8)'s plans. The link includes an explanation as for why `{{command}}` was removed.\n\nSorry for the inconvenience, and thank you for using WolfStar. 💖",
"v7NayreMessage": "Hello there! Thank you for using this command, however, it was removed and will be either redesigned as part of Nayre's Acryss RPG as mentioned in [WolfStar v7](https://skyra.notion.site/skyra/Skyra-v7-922ba06004654142a7b63347a92513a8)'s plans.\n\nSorry for the inconvenience, and thank you for using WolfStar. 💖"
"v7SkyraDescription": "Gets the information regarding WolfStar v7",
"v7SkyraExtended": {
"extendedHelp": "This is a **hidden** command used exclusively to send a notice to everyone who tries to use commands that have been removed according to [Skyra v7](https://skyra.notion.site/skyra/Skyra-v7-922ba06004654142a7b63347a92513a8) plans."
},
"v7SkyraMessage": "Hello there! Thank you for using this command, however, it was removed due to [Skyra v7](https://skyra.notion.site/skyra/Skyra-v7-922ba06004654142a7b63347a92513a8)'s plans. The link includes an explanation as for why `{{command}}` was removed.\n\nSorry for the inconvenience, and thank you for using WolfStar. 💖",
"v7NayreMessage": "Hello there! Thank you for using this command, however, it was removed and will be either redesigned as part of Nayre's Acryss RPG as mentioned in [Skyra v7](https://skyra.notion.site/skyra/Skyra-v7-922ba06004654142a7b63347a92513a8)'s plans.\n\nSorry for the inconvenience, and thank you for using WolfStar. 💖"
}
9 changes: 6 additions & 3 deletions src/lib/i18n/languageKeys/keys/commands/General.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ export const HelpDescription = T('commands/general:helpDescription');
export const HelpDm = T('commands/general:helpDm');
export const HelpExtended = T<LanguageHelpDisplayOptions>('commands/general:helpExtended');
export const HelpNoDm = T('commands/general:helpNodm');
export const V7Description = T('commands/general:v7Description');
export const V7Extended = T<LanguageHelpDisplayOptions>('commands/general:v7Extended');
export const V7Message = FT<{ command: string }>('commands/general:v7Message');
export const V7SkyraDescription = T('commands/general:v7SkyraDescription');
export const V7SkyraExtended = T<LanguageHelpDisplayOptions>('commands/general:v7SkyraExtended');
export const V7SkyraMessage = FT<{ command: string }>('commands/general:v7SkyraMessage');
export const V7NayreMessage = FT<{ command: string }>('commands/general:v7NayreMessage');
export const V7Description = T('commands/general:v7SkyraDescription');
export const V7Extended = T<LanguageHelpDisplayOptions>('commands/general:v7SExtended');
export const V7Message = FT<{ command: string }>('commands/general:v7Message');

export interface InfoComponentLabels {
addToServer: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/Sanitizer/initClean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { initClean } from '#utils/Sanitizer/clean';
import { isNullishOrEmpty } from '@sapphire/utilities';

const secrets = new Set<string>();
const suffixes = ['_KEY', '_TOKEN', '_SECRET', '_PASSWORD'];
const suffixes = ['_KEY', '_TOKEN', '_SECRET', '_PASSWORD', 'PGSQL'];
for (const [key, value] of Object.entries(process.env)) {
if (isNullishOrEmpty(value)) continue;
if (suffixes.some((suffix) => key.endsWith(suffix))) secrets.add(value);
Expand Down
102 changes: 54 additions & 48 deletions src/lib/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,66 @@ export const ZeroWidthSpace = '\u200B';
export const LongWidthSpace = '\u3000';

export const EmojiData = {
MessageAttachmentIcon: { id: '1006096566270033940', name: 'MessageAttachmentIcon', animated: false },
IntegrationIcon: { id: '1200230554440843264', name: 'IntegrationIcon', animated: false },
MembersIcon: { id: '1200212636441260103', name: 'MembersIcon', animated: false }
MessageAttachmentIcon: { id: '1262394450580340786', name: 'MessageAttachmentIcon', animated: false },
IntegrationIcon: { id: '1251906194759749653', name: 'IntegrationIcon', animated: false },
MembersIcon: { id: '1262394698287550474', name: 'MembersIcon', animated: false }
} as const;

export const enum Emojis {
ArrowB = '<:ArrowB:694594285269680179>',
ArrowBL = '<:ArrowBL:694594285118685259>',
ArrowBR = '<:ArrowBR:694594285445578792>',
ArrowL = '<:ArrowL:694594285521207436>',
ArrowR = '<:ArrowR:694594285466812486>',
ArrowT = '<:ArrowT:694594285487652954>',
ArrowTL = '<:ArrowTL:694594285625933854>',
ArrowTR = '<:ArrowTR:694594285412155393>',
BoostLevel1 = '<:boostlvl1:764841388243681322>',
BoostLevel2 = '<:boostlvl2:764841388449071134>',
BoostLevel3 = '<:boostlvl3:764841388029902891>',
BoostLevel4 = '<:boostlvl4:764841388336349225>',
BoostLevel5 = '<:boostlvl5:764841388449202198>',
BoostLevel6 = '<:boostlvl6:764841388445532200>',
BoostLevel7 = '<:boostlvl7:764841388150882305>',
BoostLevel8 = '<:boostlvl8:764841388462178344>',
BoostLevel9 = '<:boostlvl9:764841388470698014>',
Bot = '<:bot:764788923851079702>',
IntegrationIcon = '<:IntegrationIcon:1200230554440843264>',
Frame = '<:frame:764845055356698644>',
GreenTick = '<:greenTick:637706251253317669>',
GreenTickSerialized = 's637706251253317669',
Loading = '<a:sloading:656988867403972629>',
RedCross = '<:redCross:637706251257511973>',
Calendar = '<:calendar_icon:1218607529702068294>',
Hourglass = '<:hourglass:1226106863574323230>',
Member = '<:member:1200212636441260103>',
ShieldMember = '<:shield_member:1218601473664094399>',
Moderator = '<:moderator:1226106865021095977>',
// ArrowB = '<:ArrowB:694594285269680179>',
// ArrowBL = '<:ArrowBL:694594285118685259>',
// ArrowBR = '<:ArrowBR:694594285445578792>',
// ArrowL = '<:ArrowL:694594285521207436>',
// ArrowR = '<:ArrowR:694594285466812486>',
// ArrowT = '<:ArrowT:694594285487652954>',
// ArrowTL = '<:ArrowTL:694594285625933854>',
// ArrowTR = '<:ArrowTR:694594285412155393>',
ArrowLeft = '<:ArrowL:973978245580075069>',
ArrowRight = '<:ArrowR:973978026536747008>',
ArrowLeftFast = '<:ArrowFastL:973976973120528484>',
ArrowRightFast = '<:ArrowFastR:973977208978800640>',
Stop = '<:Stop:973961000313303060>',
BoostLevel1 = '<:boostlvl1:935169049523019786>',
BoostLevel2 = '<:boostlvl2:935169110311063612>',
BoostLevel3 = '<:boostlvl3:935169145056686101>',
BoostLevel4 = '<:boostlvl4:935169181362569246>',
BoostLevel5 = '<:boostlvl5:935170651117998080>',
BoostLevel6 = '<:boostlvl6:935170683653193788>',
BoostLevel7 = '<:boostlvl7:935170720365944942>',
BoostLevel8 = '<:boostlvl8:935170763894439996>',
BoostLevel9 = '<:boostlvl9:935170794374447184>',
Bot = '<:bot:1262395021173456916>',
IntegrationIcon = '<:IntegrationIcon:1251906194759749653>',
Frame = '<:frame:1262396085176107040>',
GreenTick = '<:greenTick:1043562833905987685>',
GreenTickSerialized = 's1043562833905987685',
Loading = '<a:loading:1257373445151395901>',
RedCross = '<:redCross:1043562794336919605>',
Calendar = '<:calendar_icon:1262390721399492650>',
Hourglass = '<:hourglass:1262391693823578245>',
Member = '<:member:1262381522942558208>',
ShieldMember = '<:shield_member:1262389159155335198>',
Moderator = '<:moderator:1262383567388938240>',
AutoModerator = '<:auto_moderator:1226106862147993650>',
SpammerIcon = '<:spammer:1206893298292232245>',
QuarantinedIcon = '<:quarantined:1206899526447923210>',
Reply = '<:reply:1225386830829191188>',
ReplyInactive = '<:reply_inactive:1225386832146075739>',
Flag = '<:flag:1225386828152963122>',
FlagInactive = '<:flag_inactive:1225386829558186028>',
Timer = '<:timer:1225500654399918170>',
Bucket = '<:bucket:1225500653212930160>',
Delete = '<:delete:1225386833307766854>',
DeleteInactive = '<:delete_inactive:1225386834394353675>',
Timeout = '<:timeout:1225498291131908178>',
Kick = '<:kick:1225498287092793427>',
Softban = '<:softban:1225498289131094016>',
Ban = '<:ban:1225498285637369916>'
SpammerIcon = '<:spammer:1262395235640676353>',
QuarantinedIcon = '<:quarantined:1262395690143973396>',
Reply = '<:reply:1262387069909733406>',
ReplyInactive = '<:reply_inactive:1262386545529196568>',
Flag = '<:flag:1262387528774848522>',
FlagInactive = '<:flag_inactive:1262387790348419129>',
Timer = '<:timer:985524723490381826>',
Bucket = '<:bucket:1262384919783411813>',
Delete = '<:delete:1262382721276186704>',
DeleteInactive = '<:delete_inactive:1262382743115923478>',
Timeout = '<:timeout:1262379856470212659>',
Kick = '<:kick:1262378332633174017>',
Softban = '<:softban:1262384411245150208>',
Ban = '<:ban:1262378308050489468>'
}

export const enum BrandingColors {
Primary = 0x1e88e5,
Secondary = 0xff9d01
Primary = 0x050505,
Secondary = 0xfd171b
}

export const enum Urls {
Expand All @@ -77,6 +82,7 @@ export const enum CdnUrls {
}

export const enum Invites {
Skyra = 'https://discord.com/api/oauth2/authorize?client_id=266624760782258186&permissions=292557286486&scope=bot%20applications.commands',
Dragonite = 'https://discord.com/api/oauth2/authorize?client_id=931264626614763530&permissions=81920&scope=bot%20applications.commands',
Iriss = 'https://discord.com/api/oauth2/authorize?client_id=948377113457745990&permissions=326417868864&scope=bot%20applications.commands',
Nekokai = 'https://discord.com/api/oauth2/authorize?client_id=939613684592934992&permissions=16384&scope=bot%20applications.commands',
Expand Down
9 changes: 7 additions & 2 deletions src/lib/util/deprecate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ export function makeRow(...buttons: readonly ButtonBuilder[]) {
return new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents(...buttons);
}

export const ButtonWolfV7 = new ButtonBuilder() //
.setLabel('Blog Post')
export const ButtonWolfStarV7 = new ButtonBuilder() //
.setLabel('Blog WolfStar Post')
.setStyle(ButtonStyle.Link)
.setURL('https://blog.wolfstar.rocks/wolfstar-v7');

export const ButtonSkyraV7 = new ButtonBuilder() //
.setLabel('Blog Skyra Post')
.setStyle(ButtonStyle.Link)
.setURL('https://blog.skyra.pw/skyra-v7');

Expand Down

0 comments on commit 01cc429

Please sign in to comment.