Skip to content

cedricmkl/discordinteractions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Interactions

Deno library to handle Discord Interactions via http.

Example

import {
  interactions,
  message,
} from "https://deno.land/x/discordinteractions/mod.ts";
import { serve } from "https://deno.land/std/http/server.ts";

const client = interactions({
  publicKey: "<YOUR_PUBLIC_KEY>",
})
  .slash(
    "test",
    (i) => message({ content: `Hello ${i.member?.user.username}!` }),
  );

serve(client.handle);

Registering Commands

You can register your Commands using this command:

deno run https://deno.land/x/discordinteractions/scripts/registerCommands.ts --token <BOT_TOKEN> --applicationId <APP_ID> --guildId <OPTIONAL_GUILD_ID> --file <COMMANDS_FILE>

Commands file:

[{
  "name": "test",
  "description": "This is a Test command!"
}]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published