From 8eabbe29f4f41b8cdff1396314d435d529af75ad Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 30 Jul 2024 00:45:12 -0400 Subject: [PATCH 1/3] feature(donate): readd donate command --- src/discord/commands/guild/d.donate.ts | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/discord/commands/guild/d.donate.ts diff --git a/src/discord/commands/guild/d.donate.ts b/src/discord/commands/guild/d.donate.ts new file mode 100644 index 000000000..d1dac2797 --- /dev/null +++ b/src/discord/commands/guild/d.donate.ts @@ -0,0 +1,28 @@ +import { + SlashCommandBuilder, +} from 'discord.js'; +import { SlashCommand } from '../../@types/commandDef'; +import commandContext from '../../utils/context'; +import { embedTemplate } from '../../utils/embedTemplate'; + +const F = f(__filename); + +export const dDonate: SlashCommand = { + data: new SlashCommandBuilder() + .setName('donate') + .setDescription('Get information on supporting TripSit') + .addBooleanOption(option => option.setName('ephemeral') + .setDescription('Set to "True" to show the response only to you')), + async execute(interaction) { + log.info(F, await commandContext(interaction)); + await interaction.deferReply({ ephemeral: (interaction.options.getBoolean('ephemeral') === true) }); + + const embed = embedTemplate() + .setTitle('Learn more about supporting TripSit') + .setFooter({ text: 'This command is deprecated. Please use /help and scroll down to the Support TripSit page. Thank you! <3 ' }); // eslint-disable-line max-len + await interaction.editReply({ embeds: [embed] }); + return true; + }, +}; + +export default dDonate; From f96e93d6ed85887295363a15b6898e183cae55f5 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 30 Jul 2024 13:15:59 -0400 Subject: [PATCH 2/3] donate opens help, exported help pages --- src/discord/commands/global/d.help.ts | 22 +++++++++++----------- src/discord/commands/guild/d.donate.ts | 11 +++++++---- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/discord/commands/global/d.help.ts b/src/discord/commands/global/d.help.ts index 5ca83aba8..5f5df6391 100644 --- a/src/discord/commands/global/d.help.ts +++ b/src/discord/commands/global/d.help.ts @@ -93,7 +93,7 @@ const selectMenuOptions = new ActionRowBuilder().addCom ]), ]); -async function startPage():Promise { +export async function startPage():Promise { return { embeds: [ embedTemplate() @@ -120,7 +120,7 @@ async function startPage():Promise { }; } -async function hrPage():Promise { +export async function hrPage():Promise { return { embeds: [ embedTemplate() @@ -244,7 +244,7 @@ async function hrPage():Promise { }; } -async function funPage():Promise { +export async function funPage():Promise { return { embeds: [ embedTemplate() @@ -339,7 +339,7 @@ async function funPage():Promise { }; } -async function sessionsPage():Promise { +export async function sessionsPage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Purple) @@ -351,7 +351,7 @@ async function sessionsPage():Promise { }; } -async function experiencePage():Promise { +export async function experiencePage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Purple) @@ -363,7 +363,7 @@ async function experiencePage():Promise { }; } -async function systemsPage():Promise { +export async function systemsPage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Purple) @@ -398,7 +398,7 @@ async function systemsPage():Promise { }; } -async function tripsitPage():Promise { +export async function tripsitPage():Promise { return { embeds: [ embedTemplate() @@ -476,7 +476,7 @@ async function tripsitPage():Promise { }; } -async function donatePage():Promise { +export async function donatePage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Purple) @@ -511,7 +511,7 @@ async function donatePage():Promise { }; } -async function creditsPage():Promise { +export async function creditsPage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Orange) @@ -522,7 +522,7 @@ async function creditsPage():Promise { }; } -async function feedbackPage():Promise { +export async function feedbackPage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Green) @@ -545,7 +545,7 @@ async function feedbackPage():Promise { }; } -async function invitePage():Promise { +export async function invitePage():Promise { return { embeds: [embedTemplate() .setColor(Colors.Yellow) diff --git a/src/discord/commands/guild/d.donate.ts b/src/discord/commands/guild/d.donate.ts index d1dac2797..8f23b5668 100644 --- a/src/discord/commands/guild/d.donate.ts +++ b/src/discord/commands/guild/d.donate.ts @@ -4,6 +4,7 @@ import { import { SlashCommand } from '../../@types/commandDef'; import commandContext from '../../utils/context'; import { embedTemplate } from '../../utils/embedTemplate'; +import { donatePage } from '../global/d.help'; const F = f(__filename); @@ -17,10 +18,12 @@ export const dDonate: SlashCommand = { log.info(F, await commandContext(interaction)); await interaction.deferReply({ ephemeral: (interaction.options.getBoolean('ephemeral') === true) }); - const embed = embedTemplate() - .setTitle('Learn more about supporting TripSit') - .setFooter({ text: 'This command is deprecated. Please use /help and scroll down to the Support TripSit page. Thank you! <3 ' }); // eslint-disable-line max-len - await interaction.editReply({ embeds: [embed] }); + donatePage(); + // const embed = embedTemplate() + // .setTitle('Learn more about supporting TripSit') + // .setFooter({ text: 'This command is deprecated. Please use /help and scroll down to the Support TripSit page. Thank you! <3 ' }); // eslint-disable-line max-len + // await interaction.editReply({ embeds: [embed] }); + await interaction.editReply(await donatePage()); return true; }, }; From fd14606c25a93f821f572129d1562dcd00387baa Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 30 Jul 2024 13:20:45 -0400 Subject: [PATCH 3/3] fix(donate): lint, removed commented code --- src/discord/commands/guild/d.donate.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/discord/commands/guild/d.donate.ts b/src/discord/commands/guild/d.donate.ts index 8f23b5668..c54de152f 100644 --- a/src/discord/commands/guild/d.donate.ts +++ b/src/discord/commands/guild/d.donate.ts @@ -3,7 +3,6 @@ import { } from 'discord.js'; import { SlashCommand } from '../../@types/commandDef'; import commandContext from '../../utils/context'; -import { embedTemplate } from '../../utils/embedTemplate'; import { donatePage } from '../global/d.help'; const F = f(__filename); @@ -17,12 +16,6 @@ export const dDonate: SlashCommand = { async execute(interaction) { log.info(F, await commandContext(interaction)); await interaction.deferReply({ ephemeral: (interaction.options.getBoolean('ephemeral') === true) }); - - donatePage(); - // const embed = embedTemplate() - // .setTitle('Learn more about supporting TripSit') - // .setFooter({ text: 'This command is deprecated. Please use /help and scroll down to the Support TripSit page. Thank you! <3 ' }); // eslint-disable-line max-len - // await interaction.editReply({ embeds: [embed] }); await interaction.editReply(await donatePage()); return true; },