在discord.py bot和example.py之间交换数据

时间:2018-03-09 10:32:21

标签: python python-3.x subprocess discord.py

请查看herehere

在一个非常简单的术语中,我希望接受来自机器人的输入并将其传递给'x'(TallPy.py中的变量),以便完成进一步的评估。一旦完成,机器人可以将TallPy.py的结果打印到Discord用户。我真的很困惑如何允许在两个文件之间交换数据。

@client.event
async def on_message(message):
    if message.content.startswith('.cr'):
       await client.send_message(message.channel, 'Enter the name of the creditor')
        for i in range(4):
            msg = await client.wait_for_message(')
            fmt = '{} left to go...'
            await client.send_message(message.channel, fmt.format(3 - i))

        await client.send_message(message.channel, 'Good job!')

由于

我想要实现的是将msg变量传递给Tallpy.py x变量,如下所示:

for fixed, cl, due, overdue in zip(billfixed, billcl, billdue, billoverdue):
    #Getting it all lower case and then comparing
    if x.lower() == fixed.find('BILLPARTY').text.lower():

        date = fixed.find('BILLDATE').text
        ref= fixed.find('BILLREF').text
        party = fixed.find('BILLPARTY').text

        print(' * [Inv # {}] [Date {}] [Amt {}] [Due date {}] [Overdue by {} days]'.format(
        ref, date, cl.text, due.text, overdue.text
))

print('******************************************************************')
    else:
        print('Party name not found!')
        sys.exit()

0 个答案:

没有答案