Make the direct option the easiest one to find. The order button on your Google profile, your website and your Instagram bio should all point to your own ordering page. Plenty of restaurants leave the app link as the default on their listing without realizing it, which sends even loyal guests down the commission route.
Then give people a reason. Direct ordering can carry loyalty points, a dish that is only available direct, or simply menu prices that match the dining room when the app prices are marked up. A card in every app delivery bag explains this in one line.
Delivery apps still have a role as a discovery channel for people who have never heard of you. The goal is not to leave them. It is to turn a first app order into a second order that belongs to you, with a name and an email attached.