Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @client.command(name="desc")
- async def desc(ctx, *,description = "No description"):
- if description == "remove":
- if (os.path.exists(os.path.join(os.getcwd(), "userdescriptions", str(ctx.author.id) + ".desc.txt"))):
- os.remove(os.path.join(os.getcwd(), "userdescriptions", str(ctx.author.id) + ".desc.txt"))
- await ctx.send("Your user description has been removed.")
- else:
- await ctx.send("Unable to remove your user description, because you don't have one.")
- else:
- with open(os.path.join(os.getcwd(), "userdescriptions", str(ctx.author.id) + ".desc.txt"), "w") as descriptionFile:
- descriptionFile.write(description)
- await ctx.send("Your user description has been uploaded.")
- @client.command(name="profile")
- async def profile(ctx, user:nextcord.Member=None):
- if user==None:
- user=ctx.author
- userId = user.id
- descriptionPath = os.path.join(os.getcwd(), "userdescriptions", str(userId) + ".desc.txt")
- if (os.path.exists(descriptionPath)):
- with open(descriptionPath) as descriptionFile:
- await ctx.send("User Description: ```" + descriptionFile.read() + "```")
- else:
- await ctx.send("That user does not have a description.")
Add Comment
Please, Sign In to add comment