style(bot): format Discord bot modules
This commit is contained in:
parent
50f964cdf9
commit
c27b12c76c
4 changed files with 16 additions and 7 deletions
|
|
@ -22,7 +22,10 @@ export const announceCommand: BotCommand = {
|
||||||
) as SlashCommandBuilder,
|
) as SlashCommandBuilder,
|
||||||
execute: async (interaction, payload) => {
|
execute: async (interaction, payload) => {
|
||||||
if (!interaction.inGuild() || !interaction.guild) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,7 +52,10 @@ export const announceCommand: BotCommand = {
|
||||||
const optionChannel = option && "send" in option ? (option as TextBasedChannelFields) : null;
|
const optionChannel = option && "send" in option ? (option as TextBasedChannelFields) : null;
|
||||||
const channel = optionChannel ?? (await interaction.guild.channels.fetch(channelId));
|
const channel = optionChannel ?? (await interaction.guild.channels.fetch(channelId));
|
||||||
if (!channel || !("send" in channel)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { MessageFlags, type ButtonInteraction } from "discord.js";
|
import { type ButtonInteraction, MessageFlags } from "discord.js";
|
||||||
import type { Payload } from "payload";
|
import type { Payload } from "payload";
|
||||||
import { findUserByDiscordId } from "@/bot/lib/resolve";
|
import { findUserByDiscordId } from "@/bot/lib/resolve";
|
||||||
import {
|
import {
|
||||||
|
|
@ -9,10 +9,10 @@ import {
|
||||||
} from "@/bot/services/missionEmbeds";
|
} from "@/bot/services/missionEmbeds";
|
||||||
import {
|
import {
|
||||||
attendanceClosedMessage,
|
attendanceClosedMessage,
|
||||||
|
type AttendanceResponse,
|
||||||
getMissionAttendance,
|
getMissionAttendance,
|
||||||
isMissionPast,
|
isMissionPast,
|
||||||
setMissionAttendance,
|
setMissionAttendance,
|
||||||
type AttendanceResponse,
|
|
||||||
} from "@/lib/attendance";
|
} from "@/lib/attendance";
|
||||||
|
|
||||||
const ATTENDANCE_LABELS: Record<AttendanceResponse, string> = {
|
const ATTENDANCE_LABELS: Record<AttendanceResponse, string> = {
|
||||||
|
|
@ -44,7 +44,10 @@ export const handleButtonInteraction = async (
|
||||||
try {
|
try {
|
||||||
const user = await findUserByDiscordId(payload, interaction.user.id);
|
const user = await findUserByDiscordId(payload, interaction.user.id);
|
||||||
if (!user) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import {
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
ButtonBuilder,
|
ButtonBuilder,
|
||||||
ButtonStyle,
|
ButtonStyle,
|
||||||
EmbedBuilder,
|
|
||||||
type Client,
|
type Client,
|
||||||
|
EmbedBuilder,
|
||||||
type TextBasedChannelFields,
|
type TextBasedChannelFields,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import type { Payload } from "payload";
|
import type { Payload } from "payload";
|
||||||
|
|
|
||||||
|
|
@ -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 { Payload } from "payload";
|
||||||
import type { User, UserNotification } from "@/payload-types";
|
import type { User, UserNotification } from "@/payload-types";
|
||||||
import { botConfig } from "@/bot/config";
|
import { botConfig } from "@/bot/config";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue