module.exports = {
data: new SlashCommandBuilder()
.setName('event-host')
.setDescription('Hosts/Creates a new Event.'),
async execute(interaction)
{
if (interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR))
{
return interaction.reply('```Enter the Name of your Event:```')
.then(() =>
{
const filter = m => m.content.startsWith('t');
const collector = interaction.channel.createMessageCollector({ filter , time: 5000, max: 3 });
collector.on('collect', m => interaction.channel.send(`Collected ${m.content}`));
collector.on('end', collected => interaction.channel.send(`Collected ${collected.size} items`));
});
}
else
{
return interaction.reply({ content: '```You must have Administrator permissions to be able to use this command!```', ephemeral: true});
}
},
};
The collector ends but does not collect. I tried it with awaitMessages too and that also ended with 'catch' but it did not collect either. Maybe it has something to do with async but I am not sure. I tried filter to set to m.author.id == interaction.user.id but that doesn't even make the collector work.