TamTam Echo Bot

node v10.24.1
version: 1.0.0
endpointsharetweet
Provide bot access token to your enviroment variables as TAMTAM_API_TOKEN or insert it to the code
require('axios'); const { createAPI } = require('tamtam-bot-api'); const api = createAPI(/* TAMTAM_API_TOKEN */); let MARKER = 0; async function startPolling() { const { updates, marker } = await api.getUpdates({ marker: MARKER }); MARKER = marker || MARKER; updates.map(update => { if (update.update_type === 'message_created') { const { body, sender } = update.message; return api.sendMessage({ text: body.text }, { user_id: sender.user_id }); } }); await startPolling(); } startPolling();
Loading…

no comments

    sign in to comment