I'm trying to implement this very simple first step from the TeleBot node package home page (
https://www.npmjs.com/package/telebot):
const TeleBot = require('telebot');
const bot = new TeleBot('TELEGRAM_BOT_TOKEN');
I try:
(define (require npm)
(js-eval
(string-append "require('" npm "')")))
(define TeleBot (require "telebot"))
(define telegram-token "TELEGRAM_BOT_TOKEN")
(define bot (js-new "TeleBot" telegram-token))
But obviously I'm not getting a callable constructor 'TeleBot' this way, since biwas fails with 'ReferenceError: TeleBot is not defined [js-new]'. The 'js-new' example from the biwas homepage, however, works ('js-new "Date"'). My 'TeleBot' is of type function, while 'Date' is just unbound.
How do I properly get my TeleBot constructor?