We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我在使用python版sdk开发的时候遇到了一个错误无法解决 async def sendDms(self, message, **data): """发送私信""" await self.api.create_dms(guild_id=message.guild_id, user_id=message.author.id) # await self.api.post_dms(guild_id=message.guild_id, **data) await self.api.post_dms(guild_id=message.guild_id, content="123123",msg_id=message.id) 写了一个方法专门用于来发送私聊信息,不知道哪儿出现了问题,返回报错为 File "C:/Users/16917/Desktop/qq/qqbot_django/QQ_bot/bot_main2.py", line 126, in sendDms await self.api.post_dms(guild_id=message.guild_id, content="123123",msg_id=message.id) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\api.py", line 628, in post_dms return await self._http.request(route, json=payload) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\http.py", line 121, in request return await _handle_response(route.url, response) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\http.py", line 44, in _handle_response raise error_dict_get(msg=message) botpy.errors.ServerError: internal error: direct message error
async def sendDms(self, message, **data): """发送私信""" await self.api.create_dms(guild_id=message.guild_id, user_id=message.author.id) # await self.api.post_dms(guild_id=message.guild_id, **data) await self.api.post_dms(guild_id=message.guild_id, content="123123",msg_id=message.id)
File "C:/Users/16917/Desktop/qq/qqbot_django/QQ_bot/bot_main2.py", line 126, in sendDms await self.api.post_dms(guild_id=message.guild_id, content="123123",msg_id=message.id) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\api.py", line 628, in post_dms return await self._http.request(route, json=payload) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\http.py", line 121, in request return await _handle_response(route.url, response) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\http.py", line 44, in _handle_response raise error_dict_get(msg=message) botpy.errors.ServerError: internal error: direct message error
The text was updated successfully, but these errors were encountered:
await self.api.create_dms(guild_id=message.guild_id, user_id=message.author.id)之后会返回一个私信频道的guild id,因此你await self.api.post_dms(guild_id=message.guild_id, **data)这里的guild id不应该是message.guild_id,而是创建私信时返回的私信频道id
Sorry, something went wrong.
检查是否使用了正确的guild_id
No branches or pull requests
你好,我在使用python版sdk开发的时候遇到了一个错误无法解决
async def sendDms(self, message, **data): """发送私信""" await self.api.create_dms(guild_id=message.guild_id, user_id=message.author.id) # await self.api.post_dms(guild_id=message.guild_id, **data) await self.api.post_dms(guild_id=message.guild_id, content="123123",msg_id=message.id)
写了一个方法专门用于来发送私聊信息,不知道哪儿出现了问题,返回报错为
File "C:/Users/16917/Desktop/qq/qqbot_django/QQ_bot/bot_main2.py", line 126, in sendDms await self.api.post_dms(guild_id=message.guild_id, content="123123",msg_id=message.id) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\api.py", line 628, in post_dms return await self._http.request(route, json=payload) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\http.py", line 121, in request return await _handle_response(route.url, response) File "C:\Users\16917\AppData\Local\Programs\Python\Python38\lib\site-packages\botpy\http.py", line 44, in _handle_response raise error_dict_get(msg=message) botpy.errors.ServerError: internal error: direct message error
The text was updated successfully, but these errors were encountered: