try:
cid = m.chat.id
bot.send_chat_action(cid, 'typing')
mode = "RGB"
size = 128,128
base = Image.new(mode, size, color=0).convert('RGBA')
# make a blank image for the text, initialized to transparent text color
txt = Image.new('RGBA', base.size, (255,255,255,0))
# get a font
fnt = ImageFont.load_default()
# get a drawing context
d = ImageDraw.Draw(txt)
# draw text, half opacity
d.text((10,10), "Hello", font=fnt, fill=(255,255,255,128))
# draw text, full opacity
d.text((10,60), "World", font=fnt, fill=(255,255,255,255))
out = Image.alpha_composite(base, txt)
img = out.show()
bot.send_photo(cid, img)
except Exception as e:
bot.send_message(adminid, '\xE2\x9A\xA0 Ошибка: ' +str(e))
Выдаёт ошибку 'nonetype' object has no attribute 'read'