mirror of
				https://github.com/miaowware/qrm2.git
				synced 2025-11-03 19:50:20 -05:00 
			
		
		
		
	common.py: don't error when creating embeds for users without avatars
behaviour changed in pycord 2.0: https://docs.pycord.dev/en/stable/api/models.html#discord.User.display_avatar fixes #467
This commit is contained in:
		
							parent
							
								
									5460dd811b
								
							
						
					
					
						commit
						b000c9173e
					
				@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## [Unreleased]
 | 
			
		||||
### Fixed
 | 
			
		||||
- Issue where embeds would not work for users without avatars (#467).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## [2.9.0] - 2023-01-13
 | 
			
		||||
 | 
			
		||||
@ -167,7 +167,7 @@ def embed_factory(ctx: commands.Context) -> discord.Embed:
 | 
			
		||||
    """Creates an embed with neutral colour and standard footer."""
 | 
			
		||||
    embed = discord.Embed(timestamp=datetime.utcnow(), colour=colours.neutral)
 | 
			
		||||
    if ctx.author:
 | 
			
		||||
        embed.set_footer(text=str(ctx.author), icon_url=str(ctx.author.avatar.url))
 | 
			
		||||
        embed.set_footer(text=str(ctx.author), icon_url=str(ctx.author.display_avatar))
 | 
			
		||||
    return embed
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user