【发布时间】:2020-02-24 04:39:08
【问题描述】:
这是我在尝试写下包含表情符号的帖子的 message.content 时遇到的错误。我怎样才能避免这种情况?
discord.ext.commands.errors.CommandInvokeError:命令引发异常:UnicodeEncodeError:“charmap”编解码器无法在位置编码字符“\U0001f609” 81:字符映射到
提前谢谢你。
这是我正在使用的代码:
async def posts(ctx):
f = open("file.txt", "w")
for channel in ctx.guild.text_channels:
f.write(message.content + "\n")
f.close()
【问题讨论】:
-
可以显示一些代码吗?
-
完成,抱歉忘记添加代码
-
下次在您的问题中添加代码。使用编辑按钮。而不是创建一个新的答案...
标签: discord.py discord.py-rewrite