This creates an channel that gives the author only the view channel option, meaning the author can only view it, not modify it, only the author has access to it. Just make sure to create an slash command with an option called "name" and make sure to create an category then replace 1034848287116775524 in line 20 by your category id. Also replace 1034186151252217966 at line 11 by your guild id. Make sure that your category is invisible for everyone.
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let authorid = context.params.event.member.user.id; // gets the userid of the author of the command
let authorname = context.params.event.member.user.username; // gets the username of the author of the command
let authordiscriminator = context.params.event.member.user.discriminator; // gets the discriminator of the author of the command
let options1 = context.params.event.data.options[0].value; // gets the value of the option
let result = await lib.discord.guilds['@0.2.4'].channels.create({ // creates an channel
guild_id: `1034186151252217966`, // replace the id by your guild id, it creates the channel only in that certain guild
name: `${authorname}-${options1}`, // creates an channel under the name of the author then the name (example : username-test)
topic: `id : ${authorid}, name : ${authorname}, discriminator : ${authordiscriminator}`, // sets the topic as the authorid, then the usrname, and then the discriminator
parent_id: `1034848287116775524`, // replace the id by your category id, it creates the channel in the category
});
await lib.discord.users['@0.2.1'].dms.create({ // dms the author
recipient_id: `${authorid}`, // the author you want to dm
content: `<@${authorid}> yo bro! i created a channel for you it's in <#${result.id}> `, // content of the message
});
let result1 = await lib.discord.channels['@0.3.2'].permissions.update({ // updates the permission of the channel
overwrite_id: `${authorid}`, // the person you want to change the permissions, in this case, the author
channel_id: result.id, // the channel you want to change the permissions, in this case, the channel created
allow: `${1 << 10}`, // allows an permission, in this case, the View Channel option.
type: 1, // the type of overwrite_id, 1 is an user, 0 is an role, in this case, it's an user so it's 1
});