我想给在服务器上昵称已更改的家伙扮演一个角色。可以,但是如果您没有更改昵称import sharepy
from sharepy import connect
from sharepy import SharePointSession
server='youraccount.sharepoint.com'
user='username@domain.com'
password='password'
s = sharepy.connect(server,user,password)
# Example request to Sharepoint
headers = {'accept': 'application/atom+json'} #json can be changed to xml
r = s.get("https://youraccount.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('path_to_your_folder/')/Files", headers=headers)
,但是如果他的昵称已更改,我需要删除角色和用户之间的空格。
${config.prefix}addrole <user> <role>
答案 0 :(得分:0)
我认为这是因为您放置了message.mentions.users.first()
而不是message.mentions.members.first()
。您想向公会成员而不是不和谐的用户添加角色。尝试放入let rMember = message.mentions.members.first() || message.guild.members.get(args[0]);