Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add donate command and refer it to support help page #827

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/discord/commands/global/d.help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const selectMenuOptions = new ActionRowBuilder<StringSelectMenuBuilder>().addCom
]),
]);

async function startPage():Promise<InteractionEditReplyOptions> {
export async function startPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [
embedTemplate()
Expand All @@ -120,7 +120,7 @@ async function startPage():Promise<InteractionEditReplyOptions> {
};
}

async function hrPage():Promise<InteractionEditReplyOptions> {
export async function hrPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [
embedTemplate()
Expand Down Expand Up @@ -244,7 +244,7 @@ async function hrPage():Promise<InteractionEditReplyOptions> {
};
}

async function funPage():Promise<InteractionEditReplyOptions> {
export async function funPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [
embedTemplate()
Expand Down Expand Up @@ -339,7 +339,7 @@ async function funPage():Promise<InteractionEditReplyOptions> {
};
}

async function sessionsPage():Promise<InteractionEditReplyOptions> {
export async function sessionsPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Purple)
Expand All @@ -351,7 +351,7 @@ async function sessionsPage():Promise<InteractionEditReplyOptions> {
};
}

async function experiencePage():Promise<InteractionEditReplyOptions> {
export async function experiencePage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Purple)
Expand All @@ -363,7 +363,7 @@ async function experiencePage():Promise<InteractionEditReplyOptions> {
};
}

async function systemsPage():Promise<InteractionEditReplyOptions> {
export async function systemsPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Purple)
Expand Down Expand Up @@ -398,7 +398,7 @@ async function systemsPage():Promise<InteractionEditReplyOptions> {
};
}

async function tripsitPage():Promise<InteractionEditReplyOptions> {
export async function tripsitPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [
embedTemplate()
Expand Down Expand Up @@ -476,7 +476,7 @@ async function tripsitPage():Promise<InteractionEditReplyOptions> {
};
}

async function donatePage():Promise<InteractionEditReplyOptions> {
export async function donatePage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Purple)
Expand Down Expand Up @@ -511,7 +511,7 @@ async function donatePage():Promise<InteractionEditReplyOptions> {
};
}

async function creditsPage():Promise<InteractionEditReplyOptions> {
export async function creditsPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Orange)
Expand All @@ -522,7 +522,7 @@ async function creditsPage():Promise<InteractionEditReplyOptions> {
};
}

async function feedbackPage():Promise<InteractionEditReplyOptions> {
export async function feedbackPage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Green)
Expand All @@ -545,7 +545,7 @@ async function feedbackPage():Promise<InteractionEditReplyOptions> {
};
}

async function invitePage():Promise<InteractionEditReplyOptions> {
export async function invitePage():Promise<InteractionEditReplyOptions> {
return {
embeds: [embedTemplate()
.setColor(Colors.Yellow)
Expand Down
24 changes: 24 additions & 0 deletions src/discord/commands/guild/d.donate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
SlashCommandBuilder,
} from 'discord.js';
import { SlashCommand } from '../../@types/commandDef';
import commandContext from '../../utils/context';
import { donatePage } from '../global/d.help';

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) });
await interaction.editReply(await donatePage());
return true;
},
};

export default dDonate;
Loading