$isCommandInteraction will return either true or false depending on the type of interaction.
$isCommandInteraction