SHARE
TWEET

Untitled

a guest Jun 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @client.event
  2. async def on_message(message):
  3.     if message.server is None and message.author != client.user:
  4.         server = client.get_server("serverid")
  5.         for channel in server.channels:
  6.             if channel.name == str(message.author):
  7.                 await client.send_message(message.author, "Hey you already have a support ticket open!")
  8.                 break
  9.             else:
  10.                 await client.create_channel(server, str(message.author), type=discord.ChannelType.text)
  11.                 overwrite = discord.PermissionOverwrite()
  12.                 overwrite.read_messages = True
  13.                 overwrite.send_messages = True
  14.                 overwrite.ban_members = False
  15.                 for channel in server.channels:
  16.                     if channel.name == str(message.author):
  17.                         await client.edit_channel_permissions(channel.id, message.author, overwrite)
  18.                         await client.send_message(channel.id, message.content)
  19.                         break
  20.                     else:
  21.                         break
  22.                 break
  23.     await client.process_commands(message)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top