python - client.send_file 发送图像为 0 字节不和谐 py
问题描述
每当 await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi2.png')
命中时,将一个 0 字节的文件而不是实际图像发送到通道。文件大小约为 52kb,相当小。最后发送的图像显示没有问题 ( await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi.png')
)
elif slot1 == '<:papii:492030512760750090>' and slot2 == '<:papii:492030512760750090>' and slot3 == '<:papii:492030512760750090>':
await client.edit_message(mtg, "\t{}".format(slotOutput))
await client.send_file(client.get_channel('491846919262437377'), 'slots2.png')
await client.send_message(message.channel, " {} hit 3 <:papii:492030512760750090>'s for $800! ".format(message.author.mention))
await client.send_message(message.channel, "{} moves onto the bonus round for a chance to win the jackpot!".format(message.author.mention))
add_dollars(message.author, 800)
remove_dollars(message.author, 10)
#JACKPOT BONUS ROUND
await asyncio.sleep(3)
await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi2.png')
jck = await client.send_message(message.channel, "{}".format(jackOutput))
await client.edit_message(jck, "{}".format(animationjack))
await client.edit_message(jck, "{}".format(animationjack2))
await client.edit_message(jck, "{}".format(animationjack3))
if jack1 == '' and jack2 == '' and jack3 == '' and jack4 == '' and jack5 == '':
await client.edit_message(jck, "{}".format(jackOutput))
await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi.png')
await client.send_message(message.channel, " CONGRATS {}! You've hit 5 's for an additional $1000! ".format(message.author.mention))
add_dollars(message.author, 1000)
elif jack1 == '' and jack2 == '' and jack3 == '' and jack4 == '' and jack5 == '':
await client.edit_message(jck, "{}".format(jackOutput))
await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi.png')
await client.send_message(message.channel, " CONGRATS {}! You've hit 5 's for an additional $1250! ".format(message.author.mention))
add_dollars(message.author, 1250)
elif jack1 == '<:papi:492025149525327902>' and jack2 == '<:papi:492025149525327902>' and jack3 == '<:papi:492025149525327902>' and jack4 == '<:papi:492025149525327902>' and jack5 == '<:papi:492025149525327902>':
await client.edit_message(jck, "{}".format(jackOutput))
await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi.png')
await client.send_message(message.channel, " CONGRATS {}! YOU'VE WON THE JACKPOT FOR AN ADDITIONAL $2000! ".format(message.author.mention))
add_dollars(message.author, 2000)
else:
await client.edit_message(jck, "{}".format(jackOutput))
await client.send_file(client.get_channel('491846919262437377'), 'jackpotpapi.png')
await client.send_message(message.channel, "Better luck next time {}!".format(message.author.mention))
解决方案
推荐阅读
- excel - Exist function in dictionary doesn't work for an object as Key created in a class module
- c# - 为系统循环创建高性能组件池
- python - 为什么某些网站出现 urllib 错误
- mysql - 如何减少查询的执行时间
- laravel - 如何在 Laravel 中导入具有各种模型(和子数据/模型)的单个 excel 文件/工作表?
- python - Numpy:从熊猫数据帧创建可变长度序列
- java - 从 Jhipster 中的 URL 中删除哈希 (#) (java 和 angular 6)
- css - 使用 scss 执行包含通用部分和特定部分的最小 css 规则集?
- amazon-web-services - docker 输出中的 AWS 会话管理器 ^@ 无限期
- .net - When does Start-Service know that win service actually completed full startup process and is in fully operational state?