Skip to main content
Module

x/harmony/deploy.ts>handle

An easy to use Discord API Library for Deno.
Latest
function handle
import { handle } from "https://deno.land/x/harmony@v2.9.0/deploy.ts";

Register Slash Command handler.

Example:

handle("ping", (interaction) => {
  interaction.reply("Pong!")
})

Also supports Sub Command and Group handling out of the box!

handle("command-name group-name sub-command", (i) => {
  // ...
})

handle("command-name sub-command", (i) => {
  // ...
})

Parameters

cmd: string

Command to handle. Either Handler object or command name followed by handler function in next parameter.

Handler function (required if previous argument was command name)

Parameters

cmd: string
type: ApplicationCommandType | keyof ApplicationCommandType