Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Support ES6 syntax for botkit features #1854

Merged
merged 2 commits into from
Jan 27, 2020

Conversation

cooperka
Copy link
Contributor

Now botkit can handle both CJS module.exports and ESM export default syntax.

Previously only this was supported:

module.exports = function(controller) {
    controller.hears('sample', 'message', async (bot, message) => {
        await bot.reply(message, 'I heard a sample message.');
    });
}

Now you can also, optionally, use:

export default (controller) => {
    // ...
}

@benbrown benbrown self-requested a review November 12, 2019 21:52
@benbrown benbrown added this to the 4.6.+ milestone Nov 12, 2019
@stale
Copy link

stale bot commented Jan 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 11, 2020
@cooperka
Copy link
Contributor Author

[not stale]

@stale stale bot removed the stale label Jan 11, 2020
@benbrown benbrown self-assigned this Jan 13, 2020
@benbrown
Copy link
Contributor

I'll get this merged in to the next release.

@benbrown benbrown merged commit 6fb148d into howdyai:master Jan 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants