some more fetch command shenanigans
This commit is contained in:
parent
f67ddacb88
commit
2a37d68cad
10
README.md
10
README.md
@ -1,3 +1,11 @@
|
|||||||
# bnuuy-mc-search
|
# 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
|
@ -3,8 +3,27 @@ const { SlashCommandBuilder } = require('discord.js');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('fetch')
|
.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) {
|
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);
|
||||||
},
|
},
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user