It depends on how levels are built in your game and what information you need to store in the string. For example, if there are three object types players can place on a 50x30 grid, then you can encode the entire grid into a string 1500 characters long, where letters A-C represent an object and a dot represents an empty cell:
A.A...BAC.....A.B..CBB.ABC.CCB....
Another totally different approach is to upload the string to an online service like Pastebin.com
When you upload a string, you get a unique URL, which can be used to download this string. So people can share and exchange URLs in Discord, instead of full strings.
Both uploading and downloading from Pastebin can be done with AJAX.