Python 如何从wolfram(discord.py)获取请求

Python 如何从wolfram(discord.py)获取请求,python,discord,discord.py,Python,Discord,Discord.py,我尝试了多种解决方案,但我不知道出了什么问题 我的代码: @commands.command(pass_context=True) async def ask(self, ctx, *, s: str): s.replace(' ', '+') req = requests.get("http://api.wolframalpha.com/v1/result?appid=RPYQ54-Q3W9QJKWR9&i=" + s

我尝试了多种解决方案,但我不知道出了什么问题

我的代码:

    @commands.command(pass_context=True)
    async def ask(self, ctx, *, s: str):
        s.replace(' ', '+')
        req = requests.get("http://api.wolframalpha.com/v1/result?appid=RPYQ54-Q3W9QJKWR9&i=" + s)
        author = ctx.message.author
        em = (author, req.text)
        await ctx.send(embed=em)
我的错误:

    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'tuple' object has no attribute 'to_dict'

em
变量不是
discord.Embed
实例,如果要创建嵌入,则应该是:

em=discord.Embed(title=str(ctx.author),description=req.text)
这只是一个例子,你可以随意修改,看看文档

参考: