Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklvh committed Dec 2, 2024
1 parent 0bee12d commit b29afbc
Show file tree
Hide file tree
Showing 31 changed files with 443 additions and 475 deletions.
6 changes: 3 additions & 3 deletions src/commands/fun/coinflip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { ApplyOptions } from "@sapphire/decorators";
})
export class CoinflipCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => builder.setName(this.name).setDescription(this.description),
registry.registerChatInputCommand((builder) =>
builder.setName(this.name).setDescription(this.description),
);
}

public override chatInputRun(
interaction: Command.ChatInputCommandInteraction
interaction: Command.ChatInputCommandInteraction,
) {
return interaction.reply({
embeds: [
Expand Down
55 changes: 27 additions & 28 deletions src/commands/fun/rps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,35 @@ import { ApplyOptions } from "@sapphire/decorators";
})
export class RockPaperScissorsCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addStringOption((option) =>
option
.setName("choice")
.setDescription("your choice of rock, paper, or scissors")
.setRequired(true)
.setChoices(
{
name: "Rock",
value: "Rock",
},
{
name: "Paper",
value: "Paper",
},
{
name: "Scissors",
value: "Scissors",
}
)
),
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addStringOption((option) =>
option
.setName("choice")
.setDescription("your choice of rock, paper, or scissors")
.setRequired(true)
.setChoices(
{
name: "Rock",
value: "Rock",
},
{
name: "Paper",
value: "Paper",
},
{
name: "Scissors",
value: "Scissors",
},
),
),
);
}

public override chatInputRun(
interaction: Command.ChatInputCommandInteraction
interaction: Command.ChatInputCommandInteraction,
) {
const random = Math.random();
const choice = interaction.options.getString("choice", true);
Expand All @@ -61,8 +60,8 @@ export class RockPaperScissorsCommand extends Command {
iconURL: interaction.user.avatarURL()!,
})
.addFields([
{name: "You picked", value: `\`${choice}\``, inline: true},
{name: "I picked", value: `\`${myChoice}\``, inline: true},
{ name: "You picked", value: `\`${choice}\``, inline: true },
{ name: "I picked", value: `\`${myChoice}\``, inline: true },
{
name: "Result",
value: `\`${
Expand Down
85 changes: 42 additions & 43 deletions src/commands/misc/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,51 @@ import { ApplyOptions } from "@sapphire/decorators";
})
export class AvatarCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addUserOption((option) =>
option
.setName("user")
.setDescription("the user to show the avatar of")
.setRequired(false)
)
.addNumberOption((option) =>
option
.setName("size")
.setDescription("the size of the avatar")
.setRequired(false)
.setChoices(
{name: "16", value: 16},
{name: "32", value: 32},
{name: "64", value: 64},
{name: "128", value: 128},
{name: "256", value: 256},
{name: "512", value: 512},
{name: "1024", value: 1024},
{name: "2048", value: 2048},
{name: "4096", value: 4096}
)
)
.addStringOption((option) =>
option
.setName("format")
.setDescription("the format of the avatar")
.setRequired(false)
.setChoices(
{name: "webp", value: "webp"},
{name: "png", value: "png"},
{name: "jpg", value: "jpg"},
{name: "jpeg", value: "jpeg"},
{name: "gif", value: "gif"}
)
),
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addUserOption((option) =>
option
.setName("user")
.setDescription("the user to show the avatar of")
.setRequired(false),
)
.addNumberOption((option) =>
option
.setName("size")
.setDescription("the size of the avatar")
.setRequired(false)
.setChoices(
{ name: "16", value: 16 },
{ name: "32", value: 32 },
{ name: "64", value: 64 },
{ name: "128", value: 128 },
{ name: "256", value: 256 },
{ name: "512", value: 512 },
{ name: "1024", value: 1024 },
{ name: "2048", value: 2048 },
{ name: "4096", value: 4096 },
),
)
.addStringOption((option) =>
option
.setName("format")
.setDescription("the format of the avatar")
.setRequired(false)
.setChoices(
{ name: "webp", value: "webp" },
{ name: "png", value: "png" },
{ name: "jpg", value: "jpg" },
{ name: "jpeg", value: "jpeg" },
{ name: "gif", value: "gif" },
),
),
);
}

public override async chatInputRun(
interaction: Command.ChatInputCommandInteraction
interaction: Command.ChatInputCommandInteraction,
) {
const user = interaction.options.getUser("user", false) ?? interaction.user;
const size = interaction.options.getNumber("size", false) ?? 1024;
Expand All @@ -71,7 +70,7 @@ export class AvatarCommand extends Command {
user.avatarURL({
size: size as ImageSize,
extension: format as ImageExtension,
})
}),
),
],
});
Expand Down
17 changes: 12 additions & 5 deletions src/commands/misc/serverinfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { Command, CommandOptionsRunTypeEnum } from "@sapphire/framework";
import { bold, ChannelType, EmbedBuilder, inlineCode, time, TimestampStyles, } from "discord.js";
import {
bold,
ChannelType,
EmbedBuilder,
inlineCode,
time,
TimestampStyles,
} from "discord.js";
import { ApplyOptions } from "@sapphire/decorators";

@ApplyOptions<Command.Options>({
Expand All @@ -9,13 +16,13 @@ import { ApplyOptions } from "@sapphire/decorators";
})
export class ServerInfoCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => builder.setName(this.name).setDescription(this.description),
registry.registerChatInputCommand((builder) =>
builder.setName(this.name).setDescription(this.description),
);
}

public override async chatInputRun(
interaction: Command.ChatInputCommandInteraction<"cached">
interaction: Command.ChatInputCommandInteraction<"cached">,
) {
const roles = interaction.guild.roles.cache
.sort((a, b) => b.position - a.position)
Expand Down Expand Up @@ -70,7 +77,7 @@ export class ServerInfoCommand extends Command {
inline: true,
},
])
.setFooter({text: `ID: ${interaction.guild.id}`}),
.setFooter({ text: `ID: ${interaction.guild.id}` }),
],
});
}
Expand Down
25 changes: 12 additions & 13 deletions src/commands/misc/whois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ import { ApplyOptions } from "@sapphire/decorators";
})
export class WhoisCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addUserOption((option) =>
option
.setName("user")
.setDescription("the user to show information about")
.setRequired(false)
),
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addUserOption((option) =>
option
.setName("user")
.setDescription("the user to show information about")
.setRequired(false),
),
);
}

public override async chatInputRun(
interaction: Command.ChatInputCommandInteraction
interaction: Command.ChatInputCommandInteraction,
) {
const user = interaction.options.getUser("user") ?? interaction.user;

Expand All @@ -48,7 +47,7 @@ export class WhoisCommand extends Command {
},
])

.setFooter({text: `ID: ${user.id}`}),
.setFooter({ text: `ID: ${user.id}` }),
],
});
}
Expand Down
Loading

0 comments on commit b29afbc

Please sign in to comment.