Python 3.x 在discord.py中获取附加图像的高度
我想在discord.py中获取附加到邮件的图像的高度。这是我的密码:Python 3.x 在discord.py中获取附加图像的高度,python-3.x,discord,discord.py,Python 3.x,Discord,Discord.py,我想在discord.py中获取附加到邮件的图像的高度。这是我的密码: if message.content(discord.Attachment.height > 0): await message.channel.send('Your media file is restricted!') 运行时,它会显示以下错误: error: TypeError: '>' not supported between instances of 'member_descriptor' an
if message.content(discord.Attachment.height > 0):
await message.channel.send('Your media file is restricted!')
运行时,它会显示以下错误:
error: TypeError: '>' not supported between instances of 'member_descriptor' and 'int'
discord.Attachment.height
是对象discord.Attachment
成员的height
描述符。这不涉及任何特定对象,因此需要获取特定消息上特定附件的height
属性
要获取邮件附件的高度,请执行以下操作:
discord.Attachment的filename
成员检查文件类型是否正确
message.attachments[0].height