Updated ephemreal deprecation

This commit is contained in:
2025-01-28 21:14:50 +01:00
parent a70bd4c934
commit f58c71f667
21 changed files with 67 additions and 54 deletions

View File

@@ -1,4 +1,4 @@
import { ApplicationCommandType, ContextMenuCommandBuilder, InteractionContextType, PermissionFlagsBits, userMention } from "discord.js"
import { ApplicationCommandType, ContextMenuCommandBuilder, InteractionContextType, MessageFlags, PermissionFlagsBits, userMention } from "discord.js"
import { IContextMenu } from "~/typings"
export default {
@@ -19,7 +19,7 @@ export default {
if (!message) {
interaction.reply({
content: "That user does not exist.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -36,7 +36,7 @@ export default {
await interaction.reply({
content: "Sent a congrats message",
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
} as IContextMenu

View File

@@ -1,4 +1,4 @@
import { ApplicationCommandType, ContextMenuCommandBuilder, InteractionContextType, PermissionFlagsBits } from "discord.js"
import { ApplicationCommandType, ContextMenuCommandBuilder, InteractionContextType, MessageFlags, PermissionFlagsBits } from "discord.js"
import { IContextMenu } from "~/typings"
export default {
@@ -19,7 +19,7 @@ export default {
if (!target) {
interaction.reply({
content: "That user does not exist.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -27,7 +27,7 @@ export default {
if (target.id === interaction.user.id) {
interaction.reply({
content: "You can't reset your own nickname.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -35,7 +35,7 @@ export default {
if (!target.manageable) {
interaction.reply({
content: "I cannot reset that user's nickname.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -46,7 +46,7 @@ export default {
)
interaction.reply({
content: `Reset ${target.user.username}'s nickname.`,
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
} as IContextMenu

View File

@@ -1,4 +1,4 @@
import { ApplicationCommandType, ContextMenuCommandBuilder, InteractionContextType, PermissionFlagsBits, userMention } from "discord.js"
import { ApplicationCommandType, ContextMenuCommandBuilder, InteractionContextType, MessageFlags, PermissionFlagsBits, userMention } from "discord.js"
import { getVerify } from "src/drizzle/functions.js"
import { devMessage, embedColor, hypixelGuildID } from "~/config/options.js"
import { waitingListRole } from "~/config/roles.js"
@@ -19,7 +19,7 @@ export default {
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const targetId = interaction.targetId
const user = await interaction.guild!.members.fetch(targetId)

View File

@@ -1,4 +1,4 @@
import { channelMention, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
import { channelMention, InteractionContextType, MessageFlags, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
import { embedColor } from "~/config/options.js"
import { ICommand } from "~/typings"
import logToChannel from "~/utils/Functions/logtochannel.js"
@@ -22,7 +22,7 @@ export default {
.setContexts(InteractionContextType.Guild),
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const amount = interaction.options.getInteger("amount")!
const channel = interaction.channel as TextChannel

View File

@@ -1,4 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType, InteractionContextType, SlashCommandBuilder } from "discord.js"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js"
import { devMessage, embedColor } from "~/config/options.js"
import { ICommand } from "~/typings"
@@ -139,7 +139,7 @@ export default {
if (page === 1) {
await i.reply({
content: "You are already at the first page",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -161,14 +161,14 @@ export default {
await i.reply({
content: "Page " + page,
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
if (i.customId === nextId) {
if (page === maxPage) {
await i.reply({
content: "You are already at the last page",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -190,7 +190,7 @@ export default {
await i.reply({
content: "Page " + page,
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
})

View File

@@ -1,4 +1,4 @@
import { ChannelType, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, TextChannel } from "discord.js"
import { ChannelType, InteractionContextType, MessageFlags, PermissionFlagsBits, SlashCommandBuilder, TextChannel } from "discord.js"
import { devMessage, embedColor } from "~/config/options.js"
import { ICommand } from "~/typings"
@@ -27,7 +27,7 @@ export default {
.setContexts(InteractionContextType.Guild),
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const message = interaction.options.getString("message")!
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel

View File

@@ -1,4 +1,4 @@
import { GuildMember, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { GuildMember, InteractionContextType, MessageFlags, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import { devMessage, embedColor } from "~/config/options.js"
import { ICommand } from "~/typings"
import logToChannel from "~/utils/Functions/logtochannel.js"
@@ -34,7 +34,7 @@ export default {
if (!member.manageable) {
interaction.reply({
content: "I cannot set the nickname for this user!",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -74,7 +74,7 @@ export default {
icon_url: interaction.guild!.iconURL() || undefined
}
}],
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
} as ICommand

View File

@@ -4,6 +4,7 @@ import {
ButtonStyle,
ChannelType,
InteractionContextType,
MessageFlags,
PermissionFlagsBits,
SlashCommandBuilder,
TextChannel
@@ -159,7 +160,7 @@ export default {
await interaction.reply({
content: "Message sent",
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
} as ICommand

View File

@@ -1,4 +1,13 @@
import { channelMention, ChannelType, InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
import {
channelMention,
ChannelType,
InteractionContextType,
MessageFlags,
PermissionFlagsBits,
SlashCommandBuilder,
TextChannel,
userMention
} from "discord.js"
import { devMessage, embedColor } from "~/config/options.js"
import { ICommand } from "~/typings"
import logToChannel from "~/utils/Functions/logtochannel.js"
@@ -27,7 +36,7 @@ export default {
.setContexts(InteractionContextType.Guild),
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const seconds = interaction.options.getInteger("seconds") ?? 5
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel

View File

@@ -1,4 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType } from "discord.js"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType, MessageFlags } from "discord.js"
import { devMessage, embedColor } from "~/config/options.js"
import { SubCommmndClient } from "~/typings"
@@ -126,7 +126,7 @@ const cmd: SubCommmndClient = async (interaction, client) => {
if (page === 1) {
await i.reply({
content: "You are already at the first page",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -148,14 +148,14 @@ const cmd: SubCommmndClient = async (interaction, client) => {
await i.reply({
content: "Page " + page,
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
if (i.customId === nextId) {
if (page === maxPage) {
await i.reply({
content: "You are already at the last page",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -177,7 +177,7 @@ const cmd: SubCommmndClient = async (interaction, client) => {
await i.reply({
content: "Page " + page,
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
})

View File

@@ -1,4 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, GuildMember, TextChannel } from "discord.js"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, GuildMember, MessageFlags, TextChannel } from "discord.js"
import { addGuildApp, getGuildApp } from "src/drizzle/functions.js"
import { ignM, largeM, smallM } from "~/config/limitmessages.js"
import { applicationsChannel, embedColor } from "~/config/options.js"
@@ -12,7 +12,7 @@ export default {
description: "Guild application button.",
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const user = interaction.member as GuildMember
const guild = interaction.guild!
const userRoles = user.roles.cache.map(role => role.id)

View File

@@ -1,4 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, GuildMember, TextChannel } from "discord.js"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, GuildMember, MessageFlags, TextChannel } from "discord.js"
import { ignM, largeM, smallM } from "~/config/limitmessages.js"
import { embedColor, inactivityLogChannel } from "~/config/options.js"
import { inactivity } from "~/config/questions.js"
@@ -19,7 +19,7 @@ export default {
if (!userRoles.some(role => guildRoles.includes(role.id))) {
await interaction.reply({
content: "Only guild members can use this button.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
@@ -48,14 +48,14 @@ export default {
} catch (error) {
await interaction.reply({
content: "Please enable your DMs.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
return
}
await interaction.reply({
content: "Please check your DMs.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
const input = await user.dmChannel!.awaitMessages({

View File

@@ -1,3 +1,4 @@
import { MessageFlags } from "discord.js"
import { IButton } from "~/typings"
export default {
@@ -7,7 +8,7 @@ export default {
async execute({ interaction }) {
await interaction.reply({
content: "This button is currently disabled.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
} as IButton

View File

@@ -1,3 +1,4 @@
import { MessageFlags } from "discord.js"
import { IButton } from "~/typings"
export default {
@@ -7,7 +8,7 @@ export default {
async execute({ interaction }) {
await interaction.reply({
content: "This button is currently disabled.",
ephemeral: true
flags: MessageFlags.Ephemeral
})
}
} as IButton

View File

@@ -1,4 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, GuildMember, TextChannel } from "discord.js"
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, GuildMember, MessageFlags, TextChannel } from "discord.js"
import { addStaffApp, getSetting, getStaffApp } from "src/drizzle/functions.js"
import { ignM, largeM } from "~/config/limitmessages.js"
import { embedColor, staffApplicationsChannel } from "~/config/options.js"
@@ -28,7 +28,7 @@ export default {
}
if (interaction.customId === "staffapply") {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
if (user.user.id !== env.prod.dev) {
if (status === "0") {

View File

@@ -1,3 +1,4 @@
import { MessageFlags } from "discord.js"
import { getWaitingLists, removeWaitingList } from "src/drizzle/functions.js"
import { hypixelGuildID } from "~/config/options.js"
import { IButton } from "~/typings"
@@ -8,7 +9,7 @@ export default {
description: "Update the waiting list.",
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const user = interaction.user
const message = interaction.message

View File

@@ -1,4 +1,4 @@
import { GuildMember } from "discord.js"
import { GuildMember, MessageFlags } from "discord.js"
import { addVerify, getVerify } from "src/drizzle/functions.js"
import { devMessage, embedColor, hypixelGuildID } from "~/config/options.js"
import { IModal } from "~/typings"
@@ -11,7 +11,7 @@ export default {
description: "Verify box.",
async execute({ interaction }) {
await interaction.deferReply({ ephemeral: true })
await interaction.deferReply({ flags: MessageFlags.Ephemeral })
const user = interaction.member as GuildMember
const ign = interaction.fields.fields.get("verifyign")!.value

View File

@@ -1,4 +1,4 @@
import { Events } from "discord.js"
import { Events, MessageFlags } from "discord.js"
import fs from "fs"
import path from "path"
import { embedColor } from "~/config/options.js"
@@ -28,7 +28,7 @@ export default async function loadButtonEvents(client: Client, ft: FileType) {
if (!button) {
interaction.reply({
content: "Button logic not implemented. This is most likely an old button",
ephemeral: true
flags: MessageFlags.Ephemeral
})
console.error(`No event matching ${interaction.customId} was found.`)
return
@@ -58,7 +58,7 @@ export default async function loadButtonEvents(client: Client, ft: FileType) {
description: "There was an error while executing this button!",
color: embedColor
}],
ephemeral: true
flags: MessageFlags.Ephemeral
})
} else {
await interaction.editReply({

View File

@@ -1,4 +1,4 @@
import { Events } from "discord.js"
import { Events, MessageFlags } from "discord.js"
import fs from "fs"
import path from "path"
import { embedColor } from "~/config/options.js"
@@ -26,7 +26,7 @@ export default async function loadSlashCommandsEvents(client: Client, ft: FileTy
if (!command) {
interaction.reply({
content: "Command logic not implemented. This is most likely an old command",
ephemeral: true
flags: MessageFlags.Ephemeral
})
console.error(`No command matching ${interaction.commandName} was found.`)
return
@@ -56,7 +56,7 @@ export default async function loadSlashCommandsEvents(client: Client, ft: FileTy
description: "There was an error while executing this command!",
color: embedColor
}],
ephemeral: true
flags: MessageFlags.Ephemeral
})
} else {
await interaction.editReply({

View File

@@ -1,4 +1,4 @@
import { Events } from "discord.js"
import { Events, MessageFlags } from "discord.js"
import fs from "fs"
import path from "path"
import { embedColor } from "~/config/options.js"
@@ -26,7 +26,7 @@ export default async function loadContextMenuEvents(client: Client, ft: FileType
if (!command) {
interaction.reply({
content: "Command logic not implemented. This is most likely an old command",
ephemeral: true
flags: MessageFlags.Ephemeral
})
console.error(`No command matching ${interaction.commandName} was found.`)
return
@@ -56,7 +56,7 @@ export default async function loadContextMenuEvents(client: Client, ft: FileType
description: "There was an error while executing this contextmenu command!",
color: embedColor
}],
ephemeral: true
flags: MessageFlags.Ephemeral
})
} else {
await interaction.editReply({

View File

@@ -1,4 +1,4 @@
import { Events } from "discord.js"
import { Events, MessageFlags } from "discord.js"
import fs from "fs"
import path from "path"
import { embedColor } from "~/config/options.js"
@@ -25,7 +25,7 @@ export default async function loadModalEvents(client: Client, ft: FileType) {
if (!modal) {
interaction.reply({
content: "Modal logic not implemented. This is most likely an old modal",
ephemeral: true
flags: MessageFlags.Ephemeral
})
console.error(`No modal matching ${interaction.customId} was found.`)
return