我正在为不和谐做一个自我机器人,我希望它通过服务器的邀请链接加入不和谐服务器。
Bot(command_prefix = "ChaosBot")
这就是我想要做的:
@cbot.event
async def on_ready():
print("Connected!")
await cbot.accept_invite("https://discord.gg/******")
但是我得到这个错误:
Connected!
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Program Files\Python37\lib\site-packages\discord\client.py", line 242, in _run_event
await coro(*args, **kwargs)
File "spambot.py", line 36, in on_ready
await cbot.accept_invite("https://discord.gg/uwdFUh")
AttributeError: 'Bot' object has no attribute 'accept_invite'