0
我想看看我是否能得到一個殭屍自動加入我的服務器,但是當我寫的代碼,然後運行它,我得到這個異常:齟齬 - accept_invite()錯誤403
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\datpe\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\client.py", line 275, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "C:\Users\datpe\Desktop\Python Files\discord.py-async\examples\basic_bot.py", line 7, in on_ready
await client.accept_invite('https://discord.gg/AFBEwNE')
File "C:\Users\datpe\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\client.py", line 2237, in accept_invite
yield from self.http.accept_invite(invite_id)
File "C:\Users\datpe\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\http.py", line 133, in request
raise Forbidden(r, data)
discord.errors.Forbidden: FORBIDDEN (status code: 403): Bots cannot use this endpoint
正如你可以看到,我的請求得到了Forbidden,因爲機器人不能使用這個端點
有人能給我一些見解嗎?
而且,這裏是我的代碼:
import discord
client = discord.Client()
@client.event
async def on_ready():
await client.accept_invite('https://discord.gg/AFBEwNE')
client.run('Bot Token')
這麼認爲,這很糟糕。 –