Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AceSevenFive/4852f803865ae42fa13f6400c535fc0a to your computer and use it in GitHub Desktop.
Save AceSevenFive/4852f803865ae42fa13f6400c535fc0a to your computer and use it in GitHub Desktop.
async def createUserFile(user, message):
permissions = ["Superuser", "Party Editor", "Verifier", "Bit 4", "Bit 5", "Bit 6", "Bit 7", "Bit 8"]
await client.send_message(message.channel, "Please send a series of numbers, separated by spaces, corresponding to the permissions to be set. Each bit of the permission field is as follows:")
await client.send_message(message.channel, "Bit 1: If set to 1, this user is a superuser and has all permissions." + "\r\n" + "Bit 2: If set to 1, this user can edit party information." + "\r\n" + "Bit 3: If set to 1, this user can manually verify people." + "\r\n" + "Bits 4 through 8 are unimplemented at this time.")
msg = await client.wait_for_message(timeout=30, author=message.author)
if(msg is not None):
with codecs.open(user + ".txt", "a") as file:
for x in range(0, 8):
file.write(permissions[x] + ": " + str(bool(msg.content.split(" ")[x])) + "\r\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment