The US president took to his favoured social media channel overnight to issue a warning to the world.