問題描述
我的代碼正是
這個(當(dāng)然是我的令牌)
當(dāng)我運(yùn)行它時,我的機(jī)器人正常啟動,但是當(dāng)一個新人添加到服務(wù)器時,我得到了這個.
When I run it, my bot starts up as normal, but when a new person is added to the server, i get this.
------
Ignoring exception in on_member_join
Traceback (most recent call last):
File "C:UsersUSRNAMEAppDataLocalProgramsPythonPython36libsite-packagesdiscordclient.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "test.py", line 9, in on_member_join
await client.send_message(server, fmt.format(member, server))
File "C:UsersUSRNAMEAppDataLocalProgramsPythonPython36libsite-packagesdiscordclient.py", line 1152, in send_message
data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
File "C:UsersUSRNAMEAppDataLocalProgramsPythonPython36libsite-packagesdiscordhttp.py", line 198, in request
raise NotFound(r, data)
discord.errors.NotFound: NOT FOUND (status code: 404): Unknown Channel
(對不起,它不在代碼塊中,我是堆棧交換的新手)
(Sorry about it not being in a code block, I'm new to stack exchange)
任何幫助將不勝感激.謝謝
Any help would be appreciated. Thanks
推薦答案
這將不再起作用,因?yàn)椴缓椭C刪除了默認(rèn)頻道,因此將其發(fā)送到 server
將不起作用.如果您使用異步或 discord.Object(insert channel id)
,則應(yīng)將 server
替換為 discord.Object('insert channel id')
如果您使用的是重寫分支.注意字符串與 int 的區(qū)別.祝你好運(yùn):)
This will not work anymore because discord removed default channels so sending it to server
will not work. You should replace server
with discord.Object('insert channel id')
if you are using async or discord.Object(insert channel id)
if you are using the rewrite branch. Note the string vs int difference. Good luck :)
這篇關(guān)于運(yùn)行機(jī)器人示例代碼時,我收到此錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!