client.send_file发送图像为0字节不一致py

时间:2018-10-17 07:16:56

标签: python python-3.x discord discord.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))

0 个答案:

没有答案