这是使用 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")
这是定义 userID 的函数:
async def UserID(ctx):
userID = ctx.author.id
沧海一幻觉
相关分类