1
0
Fork 0

style(bot): format Discord bot modules

This commit is contained in:
Jason Fraley 2026-08-16 23:27:51 -04:00
parent 50f964cdf9
commit c27b12c76c
4 changed files with 16 additions and 7 deletions

View file

@ -22,7 +22,10 @@ export const announceCommand: BotCommand = {
) as SlashCommandBuilder,
execute: async (interaction, payload) => {
if (!interaction.inGuild() || !interaction.guild) {
await interaction.reply({ content: "This command only works in a server.", flags: MessageFlags.Ephemeral });
await interaction.reply({
content: "This command only works in a server.",
flags: MessageFlags.Ephemeral,
});
return;
}
@ -49,7 +52,10 @@ export const announceCommand: BotCommand = {
const optionChannel = option && "send" in option ? (option as TextBasedChannelFields) : null;
const channel = optionChannel ?? (await interaction.guild.channels.fetch(channelId));
if (!channel || !("send" in channel)) {
await interaction.reply({ content: "That channel isn't a text channel.", flags: MessageFlags.Ephemeral });
await interaction.reply({
content: "That channel isn't a text channel.",
flags: MessageFlags.Ephemeral,
});
return;
}

View file

@ -1,4 +1,4 @@
import { MessageFlags, type ButtonInteraction } from "discord.js";
import { type ButtonInteraction, MessageFlags } from "discord.js";
import type { Payload } from "payload";
import { findUserByDiscordId } from "@/bot/lib/resolve";
import {
@ -9,10 +9,10 @@ import {
} from "@/bot/services/missionEmbeds";
import {
attendanceClosedMessage,
type AttendanceResponse,
getMissionAttendance,
isMissionPast,
setMissionAttendance,
type AttendanceResponse,
} from "@/lib/attendance";
const ATTENDANCE_LABELS: Record<AttendanceResponse, string> = {
@ -44,7 +44,10 @@ export const handleButtonInteraction = async (
try {
const user = await findUserByDiscordId(payload, interaction.user.id);
if (!user) {
await interaction.reply({ content: "Run /signup or /link first.", flags: MessageFlags.Ephemeral });
await interaction.reply({
content: "Run /signup or /link first.",
flags: MessageFlags.Ephemeral,
});
return;
}

View file

@ -2,8 +2,8 @@ import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
EmbedBuilder,
type Client,
EmbedBuilder,
type TextBasedChannelFields,
} from "discord.js";
import type { Payload } from "payload";

View file

@ -1,4 +1,4 @@
import { EmbedBuilder, type Client } from "discord.js";
import { type Client, EmbedBuilder } from "discord.js";
import type { Payload } from "payload";
import type { User, UserNotification } from "@/payload-types";
import { botConfig } from "@/bot/config";