Options
All
  • Public
  • Public/Protected
  • All
Menu

helly

Helly

A Node.js wrapper for interfacing with Discord.


helly


⚠️ This library is not ready for production use.


Installation

Node.js 16.9.0 or newer is required.

Stable version

npm install helly
yarn add helly
pnpm add helly
Development version
npm install helly@dev
yarn add helly@dev
pnpm add helly@dev

Optional packages

  • bufferutil for a much faster WebSocket connection (npm install bufferutil)

  • utf-8-validate in combination with bufferutil for much faster WebSocket processing (npm install utf-8-validate)

Ping Pong Example

const { Client, Events, GatewayIntentBits } = require('helly');

const client = new Client({
intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});

// Code inside here will run when the bot connects to the Discord API
client.on(Events.Ready /* you can also use 'Ready', but using enums are recommended */, () => {
console.log("Ready!"); // Log "Ready!"
});


// Code inside here will run when someone sends a message in a channel
client.on(Events.MessageCreate /* you can also use 'MessageCreate', but using enums are recommended */, (message) => {
if (message.content === '!ping') return message.reply(`🏓 ${client.ping}ms...`)
if (message.content === 'Hi') return message.reply(`Hello, ${message.author}! How are you?`)
})

// Replace TOKEN with your bot account's token
client.login('TOKEN')

Useful Links

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:14 AM