2017-10-14 68 views
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') 

回答

0

機器人不能接受邀請句號。您必須使用授權鏈接,該鏈接用於在三月的某段時間後創建的漫遊器,使用漫遊器的ID,以及在應用程序網頁中使用應用程序ID之前使用該鏈接。

https://discordapp.com/oauth2/authorize?client_id=<BOTS_ID_HERE>&scope=bot 
+0

這麼認爲,這很糟糕。 –