Fixed Deprecation of Ephemeral
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js")
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require("discord.js")
|
||||
const { mClient } = require("../..")
|
||||
require('dotenv').config()
|
||||
|
||||
@@ -36,7 +36,7 @@ module.exports = {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js")
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require("discord.js")
|
||||
const { mClient } = require("../..")
|
||||
require('dotenv').config()
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [select, row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle } = require("discord.js")
|
||||
const { EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle, MessageFlags } = require("discord.js")
|
||||
const { mClient } = require("../..")
|
||||
require('dotenv').config()
|
||||
|
||||
@@ -37,7 +37,7 @@ module.exports = {
|
||||
await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder } = require("discord.js")
|
||||
const { EmbedBuilder, MessageFlags } = require("discord.js")
|
||||
const { mClient } = require("../..")
|
||||
require('dotenv').config()
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = {
|
||||
} else if (temp[5] === '**Dishonor**'){
|
||||
honor = -1
|
||||
} else {
|
||||
return await interaction.reply({content: "ERROR", ephemeral: true})
|
||||
return await interaction.reply({content: "ERROR", flags: MessageFlags.Ephemeral})
|
||||
}
|
||||
const target = await interaction.message.guild.members.fetch(temp[3].slice(2, -1))
|
||||
temp = interaction.message.embeds[0].description.split('\r\n')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder } = require("discord.js")
|
||||
const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder, MessageFlags } = require("discord.js")
|
||||
const { mClient } = require("../..")
|
||||
require('dotenv').config()
|
||||
module.exports = {
|
||||
@@ -6,12 +6,12 @@ module.exports = {
|
||||
description: 'navigate left',
|
||||
async execute(interaction) {
|
||||
let oldEmbed = interaction.message.embeds[0].data
|
||||
if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) }
|
||||
if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', ephemeral: true }) }
|
||||
if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) }
|
||||
if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', flags: MessageFlags.Ephemeral }) }
|
||||
|
||||
let userID = interaction.message.embeds[0].data.footer.text.split(' ')[5].slice(2, -1)
|
||||
const target = await interaction.guild.members.fetch(userID)
|
||||
if (!target) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) }
|
||||
if (!target) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) }
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const quotesColl = db.collection('items_quotes')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder } = require("discord.js")
|
||||
const { EmbedBuilder, UserSelectMenuBuilder, ActionRowBuilder, MessageFlags } = require("discord.js")
|
||||
const { mClient } = require("../..")
|
||||
require('dotenv').config()
|
||||
module.exports = {
|
||||
@@ -6,12 +6,12 @@ module.exports = {
|
||||
description: 'navigate right',
|
||||
async execute(interaction) {
|
||||
let oldEmbed = interaction.message.embeds[0].data
|
||||
if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) }
|
||||
if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', ephemeral: true }) }
|
||||
if (!oldEmbed.footer) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) }
|
||||
if (oldEmbed.fields && oldEmbed.fields[0].value == 0) { return interaction.reply({ content: 'This User has no Quotes', flags: MessageFlags.Ephemeral }) }
|
||||
|
||||
let userID = interaction.message.embeds[0].data.footer.text.split(' ')[5].slice(2, -1)
|
||||
const target = await interaction.guild.members.fetch(userID)
|
||||
if (!target) { return interaction.reply({ content: 'Please use a Filter', ephemeral: true }) }
|
||||
if (!target) { return interaction.reply({ content: 'Please use a Filter', flags: MessageFlags.Ephemeral }) }
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const quotesColl = db.collection('items_quotes')
|
||||
@@ -19,7 +19,7 @@ module.exports = {
|
||||
|
||||
var index = Number((await interaction.message.embeds[0].data.title).split(' ')[2].slice(1))
|
||||
if (!index) { index = 0 }
|
||||
//if (index >= quotes.length){ return interaction.reply({content: 'Max Quotes Reached', ephemeral: true})}
|
||||
//if (index >= quotes.length){ return interaction.reply({content: 'Max Quotes Reached', flags: MessageFlags.Ephemeral})}
|
||||
if (index >= quotes.length) { index-- }
|
||||
|
||||
// will automatically reflect the next index due to how arrays think
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -79,7 +79,8 @@ module.exports = {
|
||||
// Draw the second line of text with black outline
|
||||
ctx.strokeText(text, textX, 100 + pfp.height);
|
||||
ctx.fillText(text, textX, 100 + pfp.height);
|
||||
|
||||
const banner = canvas.toBuffer();
|
||||
|
||||
channel.send({
|
||||
content: `Bitte guck einmal in die <#455023824791011338> ${member}`,
|
||||
files: [{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Events } = require('discord.js')
|
||||
const { Events, MessageFlags } = require('discord.js')
|
||||
|
||||
module.exports = {
|
||||
name: Events.InteractionCreate,
|
||||
@@ -22,9 +22,9 @@ async function commandHandler(interaction) {
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
if (interaction.replied || interaction.deferred) {
|
||||
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
await interaction.followUp({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral });
|
||||
} else {
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,9 +36,9 @@ async function buttonHandler(interaction) {
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
if (interaction.replied || interaction.deferred) {
|
||||
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
await interaction.followUp({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral });
|
||||
} else {
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,9 @@ async function selectMenuHandler(interaction) {
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
if (interaction.replied || interaction.deferred) {
|
||||
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
await interaction.followUp({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral });
|
||||
} else {
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', flags: MessageFlags.Ephemeral });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
const { EmbedBuilder, MessageFlags } = require('discord.js')
|
||||
const { mClient } = require('../../index')
|
||||
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
|
||||
require('dotenv').config()
|
||||
@@ -58,7 +58,7 @@ module.exports = {
|
||||
if (yourBalance.nuts < amount) {
|
||||
return await message.reply({
|
||||
content: 'Du kannst nicht mehr geben als du hast!',
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
var content = `Du sendest **${amount}** Nüsse an <@${target.id}>`
|
||||
|
||||
Reference in New Issue
Block a user