@client.command(pass_context=True)
async def link(ctx):
server = client.get_server("server_id")
link = client.create_invite(destination=server,xkcd=True,max_age=0,max_uses=number)
await client.say(link)
#max_age=0-> Never expire link
#max_uses-> limit to usage the link
#xkcd-> The URL fragment used for the invite if it is human readable.