Fixed Deprecation of Ephemeral
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder, Events } = require('discord.js')
|
||||
const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js')
|
||||
const { mClient } = require('../..')
|
||||
require('dotenv').config()
|
||||
|
||||
@@ -21,7 +21,7 @@ async function channelSet(interaction) {
|
||||
})
|
||||
|
||||
return await interaction.editReply({
|
||||
content: `Set <#${channel.id}> as ${purpose} channel!`, ephemeral: true
|
||||
content: `Set <#${channel.id}> as ${purpose} channel!`, flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
async function channelSimulate(interaction) {
|
||||
@@ -42,7 +42,7 @@ async function channelSimulate(interaction) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return interaction.reply({ content: 'Done.', ephemeral: true })
|
||||
return interaction.reply({ content: 'Done.', flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
async function roleSet(interaction) {
|
||||
const guild = interaction.guild
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder } = require('discord.js')
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js')
|
||||
const { mClient } = require('../..')
|
||||
require('dotenv').config()
|
||||
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
|
||||
@@ -35,7 +35,7 @@ async function honorHoner(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
async function honerDishonor(interaction) {
|
||||
@@ -69,7 +69,7 @@ async function honerDishonor(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
async function honorLeaderboard(interaction) {
|
||||
@@ -201,7 +201,7 @@ async function honorMenu(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [select, row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
module.exports = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js')
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require('discord.js')
|
||||
const { mClient } = require('../..')
|
||||
require('dotenv').config()
|
||||
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
|
||||
@@ -31,7 +31,7 @@ async function nutsGive(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
const from = interaction.user
|
||||
@@ -49,7 +49,7 @@ async function nutsGive(interaction) {
|
||||
if (yourBalance.nuts < amount) {
|
||||
return await interaction.reply({
|
||||
content: 'Du kannst nicht mehr geben als du hast!',
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
return tradeWindow('nuts_give_confirm', 'abort')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Random By Year?
|
||||
Counter (Leaderboard)
|
||||
*/
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder } = require('discord.js')
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js')
|
||||
const { mClient } = require('../..')
|
||||
require('dotenv').config()
|
||||
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
|
||||
@@ -15,7 +15,7 @@ async function quotesAdd(interaction) {
|
||||
if (!messageLink.match(regex)) {
|
||||
return await interaction.editReply({
|
||||
content: `Invalid URL`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ async function quotesAdd(interaction) {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const quotesColl = db.collection('items_quotes')
|
||||
const found = await quotesColl.findOne({ messageID: messageID })
|
||||
if (found) { return await interaction.editReply({ content: 'Quote Already in Database', ephemeral: true }) }
|
||||
if (found) { return await interaction.editReply({ content: 'Quote Already in Database', flags: MessageFlags.Ephemeral }) }
|
||||
await quotesColl.findOneAndUpdate({ messageID: messageID }, {
|
||||
$set: {
|
||||
messageID: messageID,
|
||||
@@ -89,18 +89,18 @@ async function quotesRemove(interaction) {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const quotesColl = db.collection('items_quotes')
|
||||
const found = await quotesColl.findOne({ messageID: id })
|
||||
if (!found) { return await interaction.reply({ content: 'ID not found!', ephemeral: true }) }
|
||||
if (!found) { return await interaction.reply({ content: 'ID not found!', flags: MessageFlags.Ephemeral }) }
|
||||
|
||||
await quotesColl.deleteOne({ messageID: id })
|
||||
|
||||
return interaction.reply({ content: 'Quote successfully removed!', ephemeral: true })
|
||||
return interaction.reply({ content: 'Quote successfully removed!', flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
async function quotesSearch(interaction) {
|
||||
const id = interaction.options.getString("id")
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const quotesColl = db.collection('items_quotes')
|
||||
const found = await quotesColl.findOne({ messageID: id })
|
||||
if (!found) { return await interaction.reply({ content: 'ID not found!', ephemeral: true }) }
|
||||
if (!found) { return await interaction.reply({ content: 'ID not found!', flags: MessageFlags.Ephemeral }) }
|
||||
|
||||
|
||||
const guild = await interaction.client.guilds.fetch(found.guildID)
|
||||
@@ -176,7 +176,7 @@ async function quotesRandom(interaction) {
|
||||
]).toArray()
|
||||
}
|
||||
const found = rdm[0]
|
||||
if (!found) { return await interaction.reply({ content: 'Database Empty', ephemeral: true }) }
|
||||
if (!found) { return await interaction.reply({ content: 'Database Empty', flags: MessageFlags.Ephemeral }) }
|
||||
const guild = await interaction.client.guilds.fetch(found.guildID)
|
||||
const channel = await guild.channels.fetch(found.channelID)
|
||||
const message = await channel.messages.fetch(found.messageID)
|
||||
@@ -263,7 +263,7 @@ async function quotesList(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [select, row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js')
|
||||
const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js')
|
||||
const { mClient } = require('../..')
|
||||
const { configDotenv } = require('dotenv')
|
||||
configDotenv()
|
||||
@@ -40,7 +40,7 @@ async function birthdayAdd(interaction) {
|
||||
|
||||
|
||||
if (!isValidDate(day, month)) {
|
||||
return interaction.reply({ content: "Invalid Date", ephemeral: true })
|
||||
return interaction.reply({ content: "Invalid Date", flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
@@ -48,7 +48,7 @@ async function birthdayAdd(interaction) {
|
||||
|
||||
const found = await bdayColl.findOne({ userID: target.id })
|
||||
if (found) {
|
||||
return interaction.reply({ content: "Already in Database", ephemeral: true })
|
||||
return interaction.reply({ content: "Already in Database", flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
|
||||
const data = {
|
||||
@@ -81,7 +81,7 @@ async function birthdayDelete(interaction) {
|
||||
|
||||
const found = await bdayColl.findOne({ userID: target.id })
|
||||
if (!found) {
|
||||
return interaction.reply({ content: "Not yet in Database", ephemeral: true })
|
||||
return interaction.reply({ content: "Not yet in Database", flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
|
||||
const res = await bdayColl.deleteOne({ userID: target.id })
|
||||
@@ -98,7 +98,7 @@ async function birthdayEdit(interaction) {
|
||||
|
||||
|
||||
if (!isValidDate(day, month)) {
|
||||
return interaction.reply({ content: "Invalid Date", ephemeral: true })
|
||||
return interaction.reply({ content: "Invalid Date", flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
@@ -106,7 +106,7 @@ async function birthdayEdit(interaction) {
|
||||
|
||||
const found = await bdayColl.findOne({ userID: target.id })
|
||||
if (!found) {
|
||||
return interaction.reply({ content: "Not yet in Database", ephemeral: true })
|
||||
return interaction.reply({ content: "Not yet in Database", flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
|
||||
const data = {
|
||||
@@ -147,7 +147,7 @@ async function birthdayGet(interaction) {
|
||||
|
||||
const found = await bdayColl.findOne({ userID: target.id })
|
||||
if (!found) {
|
||||
return interaction.reply({ content: "Not in Database!", ephemeral: true })
|
||||
return interaction.reply({ content: "Not in Database!", flags: MessageFlags.Ephemeral })
|
||||
}
|
||||
let unix
|
||||
if(isDateInPast(found.day,found.month)){
|
||||
@@ -226,7 +226,7 @@ module.exports = {
|
||||
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
|
||||
return await interaction.reply({
|
||||
content: "Unprivileged Access!",
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
birthdayAdd(interaction)
|
||||
@@ -235,7 +235,7 @@ module.exports = {
|
||||
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
|
||||
return await interaction.reply({
|
||||
content: "Unprivileged Access!",
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
birthdayDelete(interaction)
|
||||
@@ -244,7 +244,7 @@ module.exports = {
|
||||
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
|
||||
return await interaction.reply({
|
||||
content: "Unprivileged Access!",
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
birthdayEdit(interaction)
|
||||
|
||||
Reference in New Issue
Block a user