Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
523 B
5
Indexable
async function createTicket(guild, name, userID) {
	const channel = await guild.channels.create({
		type: ChannelType.Text,
		name,
		permissions: {
			overwrites: [
				{
					type: 'role',
					id: guild.roles.everyone.id,
					allow: {
						viewChannel: false,
					},
				},
				{
					type: 'member',
					id: userID,
					allow: {
						viewChannel: true,
					},
				},
				{
					type: 'role',
					id: AdminRole,
					allow: {
						viewChannel: true,
					},
				},
			],
		},
	})
}