Skip to content

Weldable/integration-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@weldable/integration-discord

Discord messaging and server actions for Weldable.

Part of the Weldable integration library — see @weldable/integration-core for the full catalog.

Install

npm install @weldable/integration-discord @weldable/integration-core

@weldable/integration-core is a peer dependency and must be installed alongside this package.

Usage

import integration from '@weldable/integration-discord'

// Send a message to a channel
const send = integration.actions.find(a => a.id === 'discord.send_message')!

const result = await send.execute(
  {
    channel_id: '1234567890123456789',
    content: 'Deployment to production succeeded.',
  },
  ctx, // ActionContext from your Weldable-compatible host
)

console.log(result.id) // Discord message snowflake ID

// Read recent messages
const read = integration.actions.find(a => a.id === 'discord.read_messages')!

const messages = await read.execute(
  { channel_id: '1234567890123456789', limit: 10 },
  ctx,
)

Contributing and releasing

See CONTRIBUTING.md in @weldable/integration-core for the development workflow and release process.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors