the following code does not work because it sees it as a promise waiting for fulfill to resolve, so nothing happens.
image: { // send an image
controller: async (params, next) => {
// remove tag from current message and wait for it to be sent
await next(null, '')
// now send image
let url
if (params.content.startsWith('http')) {
url = params.content
} else {
url = urlBase + params.content
}
const message = params.bot.createOutgoingMessageFor(params.update.sender.id)
message.addAttachmentFromUrl('image', url)
params.bot.sendMessage(message)
}
}
the following code does not work because it sees it as a promise waiting for fulfill to resolve, so nothing happens.