This is the code using the userID:
if message.content == "MMO start":
dir = r'C:\\Users\\User\Desktop\MMOProfiles'
MessageAuthor = str(userID)
newpath = os.path.join(dir,MessageAuthor)
doesExist = os.path.exists(newpath)
if doesExist == False:
await message.channel.send("Creating profile")
os.makedirs(newpath)
if doesExist == True:
await message.channel.send("You already have a profile")
And this is the function which is defining the userID:
async def UserID(ctx):
userID = ctx.author.id
用户 ID 已经在userID
您可以键入print(userID)
以在终端中查看它。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.