在命令中使用带有discord.py的重音符号

时间:2018-01-25 22:16:18

标签: python python-3.x discord discord.py

这是我在这里的第一篇文章,我不知道我做得对,但我希望我能找到解决方案。

我正在为法语/英语服务器创建一个discord bot,使用BeautifulSoup从网页获取翻译。你可能知道,法语中有重音,显然,discord.py在命令论证的所有重音中并不欣赏。我收到这个错误:

  

discord.ext.commands.errors。 CommandInvokeError :命令引发了一个   exception:UnicodeEncodeError:'ascii'编解码器无法编码字符   位置31的'\ xe9':序数不在范围内(128)

这是命令:

@bot.command() 
async def ft(word: str):
    """ French to English. Usage : !ft [word]"""
    [...]

我尝试输入# -*- coding: utf-8 -*-# coding: utf-8 在一开始,但这似乎不起作用。

感谢任何帮助,我做了最大的一部分,只是这个问题阻止了完成该机器人。

0 个答案:

没有答案