Skip to content

Commit 97871ef

Browse files
committed
Use flags option instead of ephemeral
1 parent 9664c52 commit 97871ef

23 files changed

Lines changed: 62 additions & 58 deletions

src/commands/chatInput/appeal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EmbedBuilder } from "discord.js";
1+
import { EmbedBuilder, MessageFlags } from "discord.js";
22
import { Command } from "#structures";
33
import { fs22Servers, fs25Servers, isMPStaff } from "#util";
44

@@ -9,7 +9,7 @@ export default new Command<"chatInput">({
99
if (
1010
interaction.channel!.parentId !== interaction.client.config.mainServer.categories.activeTickets
1111
&& !isMPStaff(interaction.member)
12-
) return await interaction.reply({ content: "You cannot use this command here", ephemeral: true });
12+
) return await interaction.reply({ content: "You cannot use this command here", flags: MessageFlags.Ephemeral });
1313

1414
await interaction.reply({ embeds: [new EmbedBuilder()
1515
.setTitle("MP Support - Ban Appeal")

src/commands/chatInput/apply.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { time } from "discord.js";
1+
import { MessageFlags, time } from "discord.js";
22
import { eq } from "drizzle-orm";
33
import { db, userLevelsTable } from "#db";
44
import { Command } from "#structures";
@@ -15,10 +15,10 @@ export default new Command<"chatInput">({
1515
if (!eligibleMsgs) deniedMsgs.push("be more active on the Discord server");
1616

1717
if (!deniedMsgs.length) {
18-
await interaction.reply({ content: interaction.client.config.resources.applyGoogleForm, ephemeral: true });
18+
await interaction.reply({ content: interaction.client.config.resources.applyGoogleForm, flags: MessageFlags.Ephemeral });
1919
await applicationLogs.send(`${interaction.user} (${interaction.user.tag}) opened an MP Staff application on ${time()}`);
2020
} else {
21-
await interaction.reply({ content: `You need to ${deniedMsgs.join(" and ")} before applying`, ephemeral: true });
21+
await interaction.reply({ content: `You need to ${deniedMsgs.join(" and ")} before applying`, flags: MessageFlags.Ephemeral });
2222
await applicationLogs.send(`${interaction.user} (${interaction.user.tag}) tried to open an MP Staff application but was rejected (**${deniedMsgs.join("** and **")}**)`);
2323
}
2424
},

src/commands/chatInput/band.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { ApplicationCommandOptionType } from "discord.js";
1+
import { ApplicationCommandOptionType, MessageFlags } from "discord.js";
22
import { Command } from "#structures";
33

44
export default new Command<"chatInput">({
55
async run(interaction) {
66
const user = interaction.options.getUser("member", true);
77

8-
await interaction.deferReply({ ephemeral: true }).then(() => interaction.deleteReply());
8+
await interaction.deferReply({ flags: MessageFlags.Ephemeral }).then(() => interaction.deleteReply());
99
await interaction.channel!.send(`${user} has received an honorary ban!`);
1010
},
1111
data: {

src/commands/chatInput/bonk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ApplicationCommandOptionType, EmbedBuilder } from "discord.js";
1+
import { ApplicationCommandOptionType, EmbedBuilder, MessageFlags } from "discord.js";
22
import { Command } from "#structures";
33

44
export default new Command<"chatInput">({
55
async run(interaction) {
66
const member = interaction.options.getMember("member");
77
let reason = interaction.options.getString("reason", false);
88

9-
if (!member) return await interaction.reply({ content: "You cannot bonk someone who's not in the server!", ephemeral: true });
9+
if (!member) return await interaction.reply({ content: "You cannot bonk someone who's not in the server!", flags: MessageFlags.Ephemeral });
1010
if (reason?.startsWith("for ")) reason = reason.replace("for ", "");
1111

1212
await interaction.reply({ embeds: [new EmbedBuilder()

src/commands/chatInput/discount.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { ApplicationCommandOptionType, PermissionFlagsBits } from "discord.js";
1+
import { ApplicationCommandOptionType, MessageFlags, PermissionFlagsBits } from "discord.js";
22
import { Command } from "#structures";
33

44
export default new Command<"chatInput">({
55
async run(interaction) {
66
const member = interaction.options.getMember("member");
77

8-
if (!member) return await interaction.reply({ content: "You need to select a member that is in this server", ephemeral: true });
8+
if (!member) return await interaction.reply({ content: "You need to select a member that is in this server", flags: MessageFlags.Ephemeral });
99

1010
await interaction.client.getChan("counting").permissionOverwrites.edit(member, { SendMessages: false });
1111
await interaction.reply(

src/commands/chatInput/hangman.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ApplicationCommandOptionType, codeBlock } from "discord.js";
1+
import { ApplicationCommandOptionType, codeBlock, MessageFlags } from "discord.js";
22
import { Command } from "#structures";
33

44
const stages = [
@@ -62,7 +62,7 @@ const stages = [
6262

6363
export default new Command<"chatInput">({
6464
async run(interaction) {
65-
await interaction.reply({ content: "Game started!", ephemeral: true });
65+
await interaction.reply({ content: "Game started!", flags: MessageFlags.Ephemeral });
6666

6767
let hiddenLetters = true;
6868
let fouls = 0;

src/commands/chatInput/loa.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Command } from "#structures";
22
import { hasRole, isMPStaff, youNeedRole } from "#util";
3+
import { MessageFlags } from "discord.js";
34

45
export default new Command<"chatInput">({
56
async run(interaction) {
@@ -16,7 +17,7 @@ export default new Command<"chatInput">({
1617
nick: `[LOA] ${interaction.member.nickname}`
1718
}).catch(() => interaction.member.roles.set(takenRoles));
1819

19-
return await interaction.reply({ content: "LOA status set", ephemeral: true });
20+
return await interaction.reply({ content: "LOA status set", flags: MessageFlags.Ephemeral });
2021
}
2122

2223
const returnedRoles = roles
@@ -31,7 +32,7 @@ export default new Command<"chatInput">({
3132
nick: interaction.member.nickname!.replaceAll("[LOA] ", "")
3233
}).catch(() => interaction.member.roles.set(returnedRoles));
3334

34-
await interaction.reply({ content: "LOA status removed", ephemeral: true });
35+
await interaction.reply({ content: "LOA status removed", flags: MessageFlags.Ephemeral });
3536
},
3637
data: {
3738
name: "loa",

src/commands/chatInput/mp22.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ApplicationCommandOptionType, EmbedBuilder } from "discord.js";
1+
import { ApplicationCommandOptionType, EmbedBuilder, MessageFlags } from "discord.js";
22
import { eq } from "drizzle-orm";
33
import { Routes } from "farming-simulator-types/2022";
44
import { db, fmNamesTable, playerTimes22Table, tfNamesTable } from "#db";
@@ -275,7 +275,7 @@ export default new Command<"chatInput">({
275275
const member = interaction.options.getMember("member");
276276
const mainRoles = interaction.client.config.mainServer.roles;
277277

278-
if (!member) return await interaction.reply({ content: "You need to select a member that is in this server", ephemeral: true });
278+
if (!member) return await interaction.reply({ content: "You need to select a member that is in this server", flags: MessageFlags.Ephemeral });
279279

280280
const roleName = interaction.options.getString("role", true) as "trustedFarmer" | "mpFarmManager" | "mpJrAdmin" | "mpSrAdmin";
281281
const roleId = mainRoles[roleName];

src/commands/chatInput/mp25.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ApplicationCommandOptionType, codeBlock, EmbedBuilder } from "discord.js";
1+
import { ApplicationCommandOptionType, codeBlock, EmbedBuilder, MessageFlags } from "discord.js";
22
import { eq } from "drizzle-orm";
33
import { Routes, WebAPIJSONAction, type WebAPIJSONResponse } from "farming-simulator-types/2025";
44
import { db, fmNamesTable, playerTimes25Table, tfNamesTable } from "#db";
@@ -247,7 +247,7 @@ export default new Command<"chatInput">({
247247
const member = interaction.options.getMember("member");
248248
const mainRoles = interaction.client.config.mainServer.roles;
249249

250-
if (!member) return await interaction.reply({ content: "You need to select a member that is in this server", ephemeral: true });
250+
if (!member) return await interaction.reply({ content: "You need to select a member that is in this server", flags: MessageFlags.Ephemeral });
251251

252252
const roleName = interaction.options.getString("role", true) as "trustedFarmer" | "mpFarmManager" | "mpJrAdmin" | "mpSrAdmin";
253253
const roleId = mainRoles[roleName];

src/commands/chatInput/private22.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
OverwriteType,
66
type TextChannel,
77
PermissionFlagsBits,
8-
roleMention
8+
roleMention,
9+
MessageFlags
910
} from "discord.js";
1011
import { Command } from "#structures";
1112
import { collectAck, fs22Servers, onPrivate22Farms, youNeedRole } from "#util";
@@ -81,7 +82,7 @@ export default new Command<"chatInput">({
8182
return interaction.reply(`You need to select a valid ${serverAcro.toUpperCase()} Farm role from the list provided!`);
8283
}
8384

84-
if (!member) return interaction.reply({ content: "You need to select a member that's in this server", ephemeral: true });
85+
if (!member) return interaction.reply({ content: "You need to select a member that's in this server", flags: MessageFlags.Ephemeral });
8586

8687
if (!member.roles.cache.has(roleId)) {
8788
await member.roles.add([roleId, serverObj.memberRole]);
@@ -137,7 +138,7 @@ export default new Command<"chatInput">({
137138

138139
const member = interaction.options.getMember("member");
139140

140-
if (!member) return interaction.reply({ content: "You need to select a member that's in this server!", ephemeral: true });
141+
if (!member) return interaction.reply({ content: "You need to select a member that's in this server!", flags: MessageFlags.Ephemeral });
141142

142143
if (!member.roles.cache.has(serverObj.farmOwnerRole)) {
143144
await member.roles.add(serverObj.farmOwnerRole);

0 commit comments

Comments
 (0)