Filter games more
This commit is contained in:
		
							parent
							
								
									b3f78a3f25
								
							
						
					
					
						commit
						0ea6f952fc
					
				| @ -34,7 +34,9 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|         body = body.concat('fields *;'); |         body = body.concat('fields *;'); | ||||||
| 
 | 
 | ||||||
|         const res = await getGameJson(body); |         let res = await getGameJson(body); | ||||||
|  |         res = res.filter(entry => entry.status == 6); | ||||||
|  |         res.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count)); | ||||||
| 
 | 
 | ||||||
|         if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true }); |         if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,9 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|         body = body.concat('fields *;'); |         body = body.concat('fields *;'); | ||||||
| 
 | 
 | ||||||
|         const res = await getGameJson(body); |         let res = await getGameJson(body); | ||||||
|  |         res = res.filter(entry => entry.status == 6); | ||||||
|  |         res.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count)); | ||||||
| 
 | 
 | ||||||
|         if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true }); |         if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -31,7 +31,9 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|         body = body.concat('fields *;'); |         body = body.concat('fields *;'); | ||||||
| 
 | 
 | ||||||
|         const res = await getGameJson(body); |         let res = await getGameJson(body); | ||||||
|  |         res = res.filter(entry => entry.status == 6); | ||||||
|  |         res.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count)); | ||||||
| 
 | 
 | ||||||
|         if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true }); |         if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user