Discord.js TypeError: Cannot read property 'client' of undefined

I encounter error “TypeError: Cannot read property ‘client’ of undefined” while writing my command i think its from this line did i write it correctly ?

if(client.guilds.cache.get(order.guildID).client.me.hasPermission("CREATE_INSTANT_INVITE")) {
								// Send message to cook.
								

								message.reply(`Order has been sent to ${client.guilds.cache.get(order.guildID).name}`);
								
                                
								// Get invite.
								
							}else {
								// Bot delivers it's self.
								client.channels.cache.get(order.channelID).send(`${client.users.cache.get(order.userID)}, Here is your taco that you ordered. Remember you can do \`.tip [Amount]\` to give us virtual tips, and \`.feedback [Feedback]\` to give us feedback on how we did. ${order.imageURL}`);

								
                                
								// Logs in console.
								console.log(colors.green(`The bot did not have the Create Instant Invite Permissions for ${client.guilds.get(order.guildID).name}, so it delivered the popsicle itself.`));
							}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.