Bots
Bots: 5-minute path
Follow the real console flow: apply → token → delivery → reply with the SDK.
Minimal Echo (Node, polling)
import { StarIMBot } from '@starim-io/bot-sdk'
const bot = new StarIMBot({
token: process.env.SOCHAT_BOT_TOKEN!,
baseUrl: process.env.SOCHAT_API_BASE!, // e.g. https://api.sochatlive.com/api/v1
secretToken: process.env.SOCHAT_WEBHOOK_SECRET,
})
bot.on('message', async (ctx) => {
const text = ctx.message?.text
if (text) await ctx.reply(text)
})
// 本地:先确保未配置 Webhook
bot.startPolling()Fact: setWebhook conflicts with getUpdates (409). Delete the webhook before polling. Official package is @starim-io/bot-sdk (legacy @sochatlive/bot-sdk is unmaintained).
