discord.net discord bot web搜索响应



好吧,所以我有一个Discord Bot,可以提供基本响应,例如:

User Input: !Doc status
Bot Output: Online!

所有基本内容,但我想创建一个响应搜索网络,并通过搜索结果回复。例如,这是一个医生机器人,所以我基本上想说:

User Input: !Doc symptoms Cough, Runny Nose, Sore throat
Bot Output: You may be experiencing the common viral infection.

,但我希望它搜索像WebMD这样的网站,并获取用户输入症状的结果,并回复该网站可能结果。

Discord Bot使用C#和JSON,因此为了创建一个简单的命令,如下:

    // The command the user types for this specified response.
    [Command("Symptom")]
    public async Task Sympton()
    {
        // Bots response
        await ReplyAsync("What symptoms are you currently having?");
    }

我遇到的问题是,我不知道如何在搜索一个网站上为用户输入的回应并以某种方式恢复了可能的疾病的反应。

您可以使用apimedic-api。您需要在网站上创建一个帐户才能做到这一点。他们在GitHub上还有代码示例,您可能会找到所需的所有内容。

最新更新