npm.io
1.0.14 • Published 3 years ago

dinteractions.js

Licence
MIT
Version
1.0.14
Deps
5
Size
36 kB
Vulns
0
Weekly
0

dinteractions.js

A discord interactions library.

import { Client } from 'dinteractions.js'

const client = new Client({
    applicationId: 'DISCORD_APPLICATION_ID',
    publicKey: 'DISCORD_PUBLIC_KEY',
    token: 'DISCORD_BOT_TOKEN'
})

client.addCommand({
    data: {
        name: 'hello',
        description: 'Replies with hello message.'
    },
    handle: async (client, interaction) => {
        await client.sendReply(interaction, {
            content: 'hello'
        })
    }
})

client.syncCommands()

client.serve('/interactions', 8000)