首页 文章

Discord.NET Discord bot网页搜索响应

提问于
浏览
0

好的,所以我有一个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

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

相关问题