Python 从不协调用户读取输入

Python 从不协调用户读取输入,python,Python,我试图读取来自discord机器人的输入,这样我的python脚本就可以根据机器人的类型进行相应的操作。假设它键入“hi”,我希望我的脚本向用户键入“hello”。唯一阻止我实现这一点的是“如何部分”。有没有一种方法可以读取不和谐用户的输入 下面是我在这个机器人上自动执行命令的脚本 import pyautogui import random import time class Dankmemberclass(): def AutomateMoney(self, Delay):

我试图读取来自discord机器人的输入,这样我的python脚本就可以根据机器人的类型进行相应的操作。假设它键入“hi”,我希望我的脚本向用户键入“hello”。唯一阻止我实现这一点的是“如何部分”。有没有一种方法可以读取不和谐用户的输入

下面是我在这个机器人上自动执行命令的脚本

import pyautogui
import random
import time


class Dankmemberclass():
    def AutomateMoney(self, Delay):

        self.delay = Delay


        commands = ["pls beg", "pls fish", "pls hunt", "pls pm", "pls hourly", "pls work"]
        while True:
            time.sleep(random.randint(self.delay, 70))

            pyautogui.typewrite(commands[0])
            time.sleep(random.randint(2, 3))
            pyautogui.press("enter")

            time.sleep(random.randint(2, 4))

            pyautogui.typewrite(commands[1])
            time.sleep(random.randint(2, 3))
            pyautogui.press("enter")

            time.sleep(random.randint(2, 4))

            pyautogui.typewrite(commands[2])
            time.sleep(random.randint(2, 3))
            pyautogui.press("enter")

            time.sleep(random.randint(2, 4))

            pyautogui.typewrite(commands[3])
            time.sleep(random.randint(2, 3))
            pyautogui.press("enter")
            pyautogui.typewrite("d")
            pyautogui.press("enter")


commands = ["pls beg", "pls fish", "pls hunt", "pls pm", "pls hourly", "pls work"]
timer = 0
while True:
    time.sleep(1)
    timer += 1
    if timer >= 3600:
        pyautogui.typewrite(commands[4])
        pyautogui.press("enter")
        time.sleep(random.randint(0, 4))
        pyautogui.typewrite(commands[5])
        pyautogui.press("enter")

尝试使用selenium,它是一个web刮板,可以读取任何web元素,因此如果在浏览器上运行discord,它可以读取它。尝试使用selenium,它是一个web刮板,可以读取任何web元素,因此如果在浏览器上运行discord,它可以读取它。