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

style: format code with Prettier #679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/commands/credits/groups/bonus/subcommands/daily/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {

if (!guild) {
throw new Error(
"Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!"
"Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!",
);
}

if (!user) {
throw new Error(
"Oops! We couldn't find your user information. Please try again or contact support for assistance."
"Oops! We couldn't find your user information. Please try again or contact support for assistance.",
);
}

Expand All @@ -51,7 +51,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
})
.setThumbnail(user.displayAvatarURL())
.setDescription(
`You've just claimed your daily treasure of **${dailyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`
`You've just claimed your daily treasure of **${dailyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`,
)
.setFooter({
text: `Claimed by ${user.username}`,
Expand All @@ -65,6 +65,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
startOfDay(addDays(new Date(), 1))
startOfDay(addDays(new Date(), 1)),
);
};
10 changes: 5 additions & 5 deletions src/commands/credits/groups/bonus/subcommands/monthly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {

if (!guild) {
throw new Error(
"Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!"
"Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!",
);
}

if (!user) {
throw new Error(
"Oops! We couldn't find your user information. Please try again or contact support for assistance."
"Oops! We couldn't find your user information. Please try again or contact support for assistance.",
);
}

Expand All @@ -47,7 +47,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
const userEconomy = await creditsManager.give(
guild,
user,
monthlyBonusAmount
monthlyBonusAmount,
);

const embed = new EmbedBuilder()
Expand All @@ -57,7 +57,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
})
.setThumbnail(user.displayAvatarURL())
.setDescription(
`You've just claimed your monthly treasure of **${monthlyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`
`You've just claimed your monthly treasure of **${monthlyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`,
)
.setFooter({
text: `Claimed by ${user.username}`,
Expand All @@ -71,6 +71,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
startOfDay(addMonths(new Date(), 1))
startOfDay(addMonths(new Date(), 1)),
);
};
8 changes: 4 additions & 4 deletions src/commands/credits/groups/bonus/subcommands/weekly/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {

if (!guild) {
throw new Error(
"Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!"
"Oops! It looks like you're not part of a guild. Join a guild to embark on this adventure!",
);
}

if (!user) {
throw new Error(
"Oops! We couldn't find your user information. Please try again or contact support for assistance."
"Oops! We couldn't find your user information. Please try again or contact support for assistance.",
);
}

Expand All @@ -53,7 +53,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
})
.setThumbnail(user.displayAvatarURL())
.setDescription(
`You've just claimed your weekly treasure of **${weeklyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`
`You've just claimed your weekly treasure of **${weeklyBonusAmount} credits**! 🎉\nEmbark on an epic adventure and spend your riches wisely.\n\n💰 **Your balance**: ${userEconomy.balance} credits`,
)
.setFooter({
text: `Claimed by ${user.username}`,
Expand All @@ -67,6 +67,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
startOfDay(addWeeks(new Date(), 1))
startOfDay(addWeeks(new Date(), 1)),
);
};
2 changes: 1 addition & 1 deletion src/commands/credits/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await executeSubcommand(
interaction,
subcommandHandlers,
subcommandGroupHandlers
subcommandGroupHandlers,
);
};
12 changes: 6 additions & 6 deletions src/commands/credits/subcommands/balance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const builder = (command: SlashCommandSubcommandBuilder) => {
option
.setName("account")
.setDescription(
"Enter the username of another user to check their balance"
)
"Enter the username of another user to check their balance",
),
);
};

Expand All @@ -44,15 +44,15 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
checkAccount,
isUserCheckAccount,
pronoun,
possessivePronoun
possessivePronoun,
);

await sendAccountBalanceEmbed(
interaction,
description,
checkAccount,
pronoun,
possessivePronoun
possessivePronoun,
);
};

Expand All @@ -61,7 +61,7 @@ const getAccountBalanceDescription = (
checkAccount: User,
isUserCheckAccount: boolean,
pronoun: string,
possessivePronoun: string
possessivePronoun: string,
) => {
let description = `${
isUserCheckAccount ? "You" : checkAccount
Expand All @@ -87,7 +87,7 @@ const sendAccountBalanceEmbed = async (
description: string,
checkAccount: User,
pronoun: string,
possessivePronoun: string
possessivePronoun: string,
) => {
await sendResponse(interaction, {
embeds: [
Expand Down
14 changes: 7 additions & 7 deletions src/commands/credits/subcommands/gift/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ export const builder = (command: SlashCommandSubcommandBuilder) => {
option
.setName("account")
.setDescription("👤 The account you want to gift to")
.setRequired(true)
.setRequired(true),
)
.addIntegerOption((option) =>
option
.setName("amount")
.setDescription("💰 The amount you want to gift")
.setRequired(true)
.setMinValue(1)
.setMaxValue(2147483647)
.setMaxValue(2147483647),
)
.addStringOption((option) =>
option
.setName("message")
.setDescription("💬 Your personalized message to the account")
.setDescription("💬 Your personalized message to the account"),
);
};

Expand Down Expand Up @@ -63,14 +63,14 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
guild,
recipient,
amount,
message
message,
);
const senderEmbed = await createSenderEmbed(
guild,
user,
recipient,
amount,
message
message,
);

await recipient.send({ embeds: [recipientEmbed] });
Expand All @@ -83,7 +83,7 @@ const createRecipientEmbed = async (
guild: Guild,
recipient: User,
amount: number,
message: string | null
message: string | null,
) => {
const recipientEmbed = new EmbedBuilder()
.setTimestamp()
Expand Down Expand Up @@ -113,7 +113,7 @@ const createSenderEmbed = async (
sender: User,
recipient: User,
amount: number,
message: string | null
message: string | null,
) => {
const senderEmbed = new EmbedBuilder()
.setTimestamp()
Expand Down
4 changes: 2 additions & 2 deletions src/commands/credits/subcommands/top/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export const execute = async (interaction: CommandInteraction) => {
const medalEmoji =
position <= 3 ? medalEmojis[position - 1] : genericMedalEmoji;
return `\`${medalEmoji} ${fieldContent}\``;
})
}),
);

const description = `Here are the top users in this server:\n\n${topUsersDescription.join(
"\n"
"\n",
)}`;
embed.setDescription(description);

Expand Down
10 changes: 5 additions & 5 deletions src/commands/credits/subcommands/work/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {

if (!guild) {
throw new Error(
"Oops! It seems like you're not part of a guild. Join a guild to use this command!"
"Oops! It seems like you're not part of a guild. Join a guild to use this command!",
);
}

if (!user) {
throw new Error(
"Oops! It looks like we couldn't find your user information. Please try again or contact support for assistance."
"Oops! It looks like we couldn't find your user information. Please try again or contact support for assistance.",
);
}

Expand Down Expand Up @@ -84,7 +84,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {

// Work Description
descriptions.push(
`Mission complete! You've earned **${baseCreditsEarned} credits**! 🎉`
`Mission complete! You've earned **${baseCreditsEarned} credits**! 🎉`,
);

// Bonus Description
Expand All @@ -99,7 +99,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {

// Total Credits Description
descriptions.push(
`Total earnings: **${creditsEarned} credits**. Keep up the hustle!`
`Total earnings: **${creditsEarned} credits**. Keep up the hustle!`,
);

if (creditsEarned > 0) {
Expand Down Expand Up @@ -133,6 +133,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
addHours(new Date(), 1)
addHours(new Date(), 1),
);
};
10 changes: 5 additions & 5 deletions src/commands/dns/subcommands/lookup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const cooldownManager = new CooldownManager();
const dnsLookup = promisify(dns.lookup);

export const builder = (
command: SlashCommandSubcommandBuilder
command: SlashCommandSubcommandBuilder,
): SlashCommandSubcommandBuilder => {
return command
.setName("lookup")
Expand All @@ -26,12 +26,12 @@ export const builder = (
option
.setName("query")
.setDescription("The query you want to look up.")
.setRequired(true)
.setRequired(true),
);
};

export const execute = async (
interaction: ChatInputCommandInteraction
interaction: ChatInputCommandInteraction,
): Promise<void> => {
await deferReply(interaction, false);

Expand Down Expand Up @@ -75,12 +75,12 @@ export const execute = async (
await generateCooldownName(interaction),
guild || null,
user,
addSeconds(new Date(), 5)
addSeconds(new Date(), 5),
);
} catch (error: unknown) {
if ((error as NodeJS.ErrnoException).code === "ENOTFOUND") {
throw new Error(
`Sorry, we couldn't find the address for the requested query: ${query}.`
`Sorry, we couldn't find the address for the requested query: ${query}.`,
);
} else {
throw error;
Expand Down
12 changes: 6 additions & 6 deletions src/commands/fun/subcommands/meme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const builder = (command: SlashCommandSubcommandBuilder) => {
};

export const execute = async (
interaction: ChatInputCommandInteraction
interaction: ChatInputCommandInteraction,
): Promise<void> => {
await deferReply(interaction, false);

Expand All @@ -59,21 +59,21 @@ export const execute = async (
});
} catch (error) {
throw new Error(
"Sorry, we couldn't fetch a meme at the moment. Please try again later."
"Sorry, we couldn't fetch a meme at the moment. Please try again later.",
);
}

await cooldownManager.setCooldown(
await generateCooldownName(interaction),
guild || null,
user,
addSeconds(new Date(), 5)
addSeconds(new Date(), 5),
);
};

async function fetchRandomMeme(): Promise<MemeContent> {
const { data } = await axios.get(
"https://www.reddit.com/r/memes/random/.json"
"https://www.reddit.com/r/memes/random/.json",
);
const { children } = data[0].data;
const content: MemeContent = children[0].data;
Expand All @@ -82,7 +82,7 @@ async function fetchRandomMeme(): Promise<MemeContent> {

async function fetchAuthorData(author: string): Promise<AuthorData> {
const { data } = await axios.get(
`https://www.reddit.com/user/${author}/about.json`
`https://www.reddit.com/user/${author}/about.json`,
);
const authorData: AuthorData = data.data;
return authorData;
Expand All @@ -94,7 +94,7 @@ function createButtons(permalink: string) {
.setLabel("View post")
.setStyle(ButtonStyle.Link)
.setEmoji("🔗")
.setURL(`https://reddit.com${permalink}`)
.setURL(`https://reddit.com${permalink}`),
);
}

Expand Down
Loading
Loading