Profile
Back to NewsBack
GitHub Trending 1 min
Reader Mode
luisfun/discord-hono: Discord bot framework built for the Edge

luisfun/discord-hono: Discord bot framework built for the Edge

13 hours ago

🔥 Discord Hono npm v</a> Bundle Size</a> Discord</a>

Easily build HTTP-based Discord bots on Cloudflare Workers — so you can focus on what matters.

👉 Documentation💥 Breaking Changes

This project is influenced by Hono. Thank you for Yusuke Wada and Hono contributors!

Features

  • Intuitive API - Influenced by Hono, offering a familiar and easy-to-use interface
  • Lightweight - Zero runtime dependencies, optimized for performance
  • Type-Safe - Native support for TypeScript

Install

npm i discord-hono
npm i -D discord-api-types # When using TypeScript

npm i -D @types/node # As needed

Example Code

index.ts

import { DiscordHono } from 'discord-hono'

const app = new DiscordHono() .command('hello', c => c.res('Hello, World!'))

export default app

register.ts

import { makeSlashCommand, register } from 'discord-hono'

const commands = [ makeSlashCommand('hello', 'Hello, World!'), ]

register( commands, process.env.DISCORD_APPLICATION_ID, process.env.DISCORD_TOKEN, //process.env.DISCORD_TEST_GUILD_ID, )

Health

CodeQL</a> Codecov</a> OpenSSF</a>

Links

References

Chat with me