Replace fetching cache for user in applicationopen

Instead fetch guild members
This commit is contained in:
Ninjdai1 2023-09-04 13:01:36 +02:00
parent c24626b0f0
commit 78b5377cdb

View File

@ -5,10 +5,10 @@ module.exports = {
interaction.deferReply({ ephemeral: true }); interaction.deferReply({ ephemeral: true });
const embedToSend = interaction.message.embeds[0]; const embedToSend = interaction.message.embeds[0];
const userId = interaction.customId.replace("applicationopen_",""); const userId = interaction.customId.replace("applicationopen_","");
const member = client.users.cache.find(user => user.id === userId) const member = await interaction.guild.members.fetch(userId);
await interaction.guild.channels.create({ await interaction.guild.channels.create({
name: `candidature-${member.username}`, name: `candidature-${member.user.username}`,
type: ChannelType.GuildText, type: ChannelType.GuildText,
parent: '916721453121040424', parent: '916721453121040424',
permissionOverwrites: [ permissionOverwrites: [