import { Hono } from 'hono'
import { makeTownsBot } from '@towns-protocol/bot'
const bot = await makeTownsBot(privateData, jwtSecret)
await bot.start()
const app = new Hono()
const channels: string[] = []
bot.onSlashCommand('/set-channel', async (handler, event) => {
const { channelId } = event
channels.push(channelId)
await handler.sendMessage(channelId, 'Channel set successfully')
})
setInterval(async () => {
const tokenPrice = await fetchTokenPriceApi('ETH')
for (const channelId of channels) {
await bot.sendMessage(channelId, "💰 ETH update: $" + tokenPrice)
}
}, 60_000)