The way of getting the server icon url changed. The icon is stored as an Asset in guild.icon, if an icon is set. The URL of an Asset is stored in the url field.
def get_logo_url(guild: discord.Guild) -> Optional[str]:
if guild.icon is not None:
return guild.icon.url
return None