def _get_recent_image(channel: discord.TextChannel) -> typing.Optional[discord.Message]:
async for msg in channel.history(limit=100):
# Scan any attached images.
for attachment in msg.attachments:
if attachment.height:
return attachment.proxy_url
# Scan any embeds in the message.
for embed in msg.embeds:
if embed.image is discord.Embed.Empty:
continue
return embed.image.proxy_url
评论列表
文章目录