const Twilio 	= require('twilio')

const client = new Twilio(
	process.env.TWILIO_ACCOUNT_SID,
	process.env.TWILIO_AUTH_TOKEN)

module.exports.createChannel = (name) => {
	const data = {
		friendlyName: 'Support Chat with ' + name,
		uniqueName: 'support_channel_' + Math.random().toString(36).substring(7)
	}

	return new Promise((resolve, reject) => {
		client.chat.services(process.env.TWILIO_CHAT_SERVICE_SID).channels.create(data)
			.then(channel => {
				resolve(channel)
			}).catch(error => {
				reject(error)
			})

	})

}
@@ -1,15 +1,15 @@
 const 
-T
+t
 wilio %09=
@@ -47,13 +47,9 @@
 t = 
-new T
+t
 wili
@@ -165,21 +165,89 @@
  %7B%0A%09
-const data = 
+return client.chat.services(process.env.TWILIO_CHAT_SERVICE_SID).channels.create(
 %7B%0A%09%09
@@ -370,228 +370,7 @@
 )%0A%09%7D
-%0A%0A%09return new Promise((resolve, reject) =%3E %7B%0A%09%09client.chat.services(process.env.TWILIO_CHAT_SERVICE_SID).channels.create(data)%0A%09%09%09.then(channel =%3E %7B%0A%09%09%09%09resolve(channel)%0A%09%09%09%7D).catch(error =%3E %7B%0A%09%09%09%09reject(error)%0A%09%09%09%7D)%0A%0A%09%7D)%0A
+)
 %0A%7D

remove nested promise