There is at least a kernel of truth here for sure. Here is a relevant article which described Europe's role in the gradual decline of slavery in Africa:
Although colonial authorities began outlawing slavery in some African
territories as early as the 1830s, the complete legal abolition of
slavery in Africa did not take place until the first quarter of the
20th century. By that time, however, slavery was deeply ingrained in
most African societies, and thus the practice continued illegally.
Slaves who became liberated often did so by escaping and going to the
colonial authorities or by simply leaving the areas in which they had
been held to take up residence elsewhere. In some places, enslaved
persons held that status throughout their lives, despite the legal
prohibition. It was not until the 1930s that slavery in Africa was
almost totally eliminated.
However the role of European colonial powers in ending slavery, relative to other factors, should not be over-emphasized. As the Wikipedia article on slavery in the Muslim world puts it:
Throughout the 19th and 20th centuries, slavery gradually became
outlawed and suppressed in Muslim lands, due to a combination of
pressure exerted by Western nations such as Britain and France,
internal pressure from Islamic abolitionist movements, and economic
A key episode in the early part of this process was in the 1830s when the Barbary slave trade was ended as a result of the French colonization of Algeria. But for about two centuries prior to this, Europeans played the most pivotal role in driving the expansion of the much larger slave trade in West Africa and the Atlantic.