Fix /reset crashing sometimes
This commit is contained in:
		
							parent
							
								
									dd5d426c94
								
							
						
					
					
						commit
						042a63ca0a
					
				
							
								
								
									
										4
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								index.js
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -67,6 +67,10 @@ client.on('interactionCreate', async (interaction) => {
 | 
			
		|||
	switch (interaction.commandName) {
 | 
			
		||||
		case "reset":
 | 
			
		||||
			// Remove the session
 | 
			
		||||
			if (!sessions[interaction.channelId]) return interaction.reply({
 | 
			
		||||
				ephemeral: true,
 | 
			
		||||
				content: lang.empty
 | 
			
		||||
			});
 | 
			
		||||
			if (!sessions[interaction.channelId].processing) {
 | 
			
		||||
				await resetSession(interaction.channelId);
 | 
			
		||||
				interaction.reply(lang.reset);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue