A former Glasgow police officer was caught drug dealing after he used ChatGPT to ask how to conceal smells.