A Node.js wrapper for interfacing with Discord.
npm install helly
yarn add helly
pnpm add helly
npm install helly@dev
yarn add helly@dev
pnpm add helly@dev
-
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
)
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')
- The website has more details and documentation.
- The GitHub repo is where development primarily happens.
- The NPM package webpage is, well, the webpage for the NPM package.
- Denky Labs Discord server helly support server on discord