No, Discord can not detect pirated games. If you have any non-steam or non-verified games, Discord is not apt to detect that game. So, if you have any game that you want Discord to detect then make sure that it is not pirated.