why do i become when i run this function as callback [object Promise] ? i use the Ts3 nodejs framework by Miltivit4min (Github)
here some code i tried (return value = [object Promise])
async function getChannelName(cid) {
await teamspeak.getChannelByID(cid).then(data => {
return data.name;
});
};
how can i convert this value to a string with a value like "My cool Channel"
best regards
An
asyncfunction always returns aPromiseby design and yourgetChannelNamefunction has no return statement, so the promise is never resolved. Also you are mixing up someawaitand.then()syntax, you only need one of them.