Discord.NET Discord bot网页搜索响应

时间:2018-04-01 04:55:54

标签: c# json bots discord

好的,所以我有一个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?");
    }

我遇到的问题是我不知道如何搜索网站以查找用户输入的响应,并以某种方式得到可能的疾病的回复。

1 个答案:

答案 0 :(得分:0)

您可以使用ApiMedic-Api。您需要在网站上创建一个帐户才能执行此操作。 他们还在Github上有代码示例,您可能会找到所需的一切。