Skip to content

This library enables you to easily build Discord bots on Cloudflare Workers

License

Notifications You must be signed in to change notification settings

ghaaj/discord-hono

 
 

Repository files navigation

🔥 Discord Hono npm v Bundle Size Codecov Discord

This library enables you to easily build Discord bots on Cloudflare Workers

👉 Documentation

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 dependencies, optimized for performance
  • Type-Safe - Native support for TypeScript

Install

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

Example Code

index.ts

import { DiscordHono } from 'discord-hono'

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

export default app

register.ts

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

const commands = [
  new Command('hello', 'response world'),
]

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

References

About

This library enables you to easily build Discord bots on Cloudflare Workers

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%