Although you did your research, you missed that it mentions on the top of the page that v12 introduces the concept of managers, you will no longer be able to directly use collection methods. https://discordjs.guide/additional-info/changes-in-v12.html#managers-cache
You will now have to directly ask for cache on a manager before trying to use collection methods:
.addField("Role Count:", `${message.guild.roles.cache.size}`, true)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…