Holders Rangers will face St Johnstone at Hampden in the second round of the Premier Sports Cup.
Celtic were also drawn out of the hat first to take on Hibernian.
Motherwell will host Kilmarnock after edging through, following a goalless home draw against Partick Thistle.
Hearts have been handed a tricky tie away to Falkirk, while Spartans were rewarded for winning their group with a home draw against Ross County.
Aberdeen host Queen’s Park, Dundee welcome Airdrie, and Dundee United will take on St Mirren at Tannadice in ties that will be played on the weekend of August 17-18.
Thistle needed to win at Fir Park just before the draw to replace their hosts at the top of Group G and had the chances to do so.
But Motherwell ultimately saw out the game in the Thistle half and the visitors’ 3-1 penalty shoot-out win for the bonus point was irrelevant.
The Jags started the better team and Dan MacKay missed a glorious chance from close range before Brian Graham just failed to reach a low cross.
Thistle goalkeeper Mason McCready made two excellent stops just before the half-hour mark, pushing Zach Robinson’s curling effort on to the crossbar and pushing Liam Gordon’s header over.
Mackay twice got in behind in the second half but Aston Oxborough stood up to save his shot and Graham hit the winger’s cutback just over as he stretched.
Motherwell missed three of their four penalties in the shoot-out and Oxborough just failed to record his third stop as Luke McBeth’s effort went in off the goalkeeper’s hands.