亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

discord py,嘗試發送圖像

discord py,嘗試發送圖像

慕桂英3389331 2022-07-26 10:57:37
試圖發送圖像從帖子中復制了這段代碼,我添加了一些。ch = get(member.guild.channels, name="general")# where i want to send an image #this is my animated gif from this line I copied but no idea where Image function come from image = Image.open("./images/welcome.gif")with BytesIO() as image_binary:   image.save(image_binary, "gif")   image_binary.seek(0)   await ch.send(file=discord.File(fp=image_binary))我通過 pip 安裝了 Image 并添加了 import Image 然后出現錯誤所以我認為這不是來自 pip 的模塊有任何想法嗎?
查看完整描述

1 回答

?
陪伴而非守候

TA貢獻1757條經驗 獲得超8個贊

你會想要Pillow圖書館。

pip install Pillow

Image然后,從導入PIL

from PIL import Image


查看完整回答
反對 回復 2022-07-26
  • 1 回答
  • 0 關注
  • 94 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號