some more fetch command shenanigans

This commit is contained in:
jaezu 2025-07-30 22:52:01 +02:00
parent f67ddacb88
commit 2a37d68cad
2 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,11 @@
# bnuuy-mc-search
bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy bnuuy
Fetches all death messages from a predetermined channel.
## How it works
run ``/fetch`` in the channel you want to fetch the death messages
## Reporting bugs
Don't bother, they won't be fixed

View File

@ -3,8 +3,27 @@ const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('fetch')
.setDescription('Fetch\'s All Youre Data\'s !! :3'),
.setDescription('Fetches all messages from a specified user and scans them for death messages')
.addUserOption(option => option.setName('user').setDescription('User to fetch messages from').setRequired(true)),
async execute(interaction) {
await interaction.reply('fuck yoy');
const target = interaction.options.getUser('user');
await interaction.deferReply();
console.log(target);
await interaction.guild.members.fetch(target, { force: true })
.then((member) => {
targetId = member.id;
})
.catch(error => console.error(`error. ${error}`));
await interaction.channel.messages.fetch()
.then((messages) => {
messages.filter(message => message.author.id === targetId);
console.log(messages);
for (message in messages) {
console.log(message);
console.log(message.content);
}
})
.catch(console.error);
await interaction.editReply(targetId);
},
};